port_test.go 366 B

12345678910111213141516171819
  1. package net_test
  2. import (
  3. "testing"
  4. . "github.com/v2ray/v2ray-core/common/net"
  5. v2testing "github.com/v2ray/v2ray-core/testing"
  6. "github.com/v2ray/v2ray-core/testing/assert"
  7. )
  8. func TestPortRangeContains(t *testing.T) {
  9. v2testing.Current(t)
  10. portRange := &PortRange{
  11. From: Port(53),
  12. To: Port(53),
  13. }
  14. assert.Bool(portRange.Contains(Port(53))).IsTrue()
  15. }