github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/common/net/port_test.go (about) 1 package net_test 2 3 import ( 4 "testing" 5 6 . "github.com/v2fly/v2ray-core/v5/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 }