github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/common/net/port_test.go (about) 1 package net_test 2 3 import ( 4 "testing" 5 6 . "github.com/xtls/xray-core/common/net" 7 ) 8 9 func TestPortRangeContains(t *testing.T) { 10 portRange := &PortRange{ 11 From: 53, 12 To: 53, 13 } 14 15 if !portRange.Contains(Port(53)) { 16 t.Error("expected port range containing 53, but actually not") 17 } 18 }