v2ray-core/common/net/port_test.go

19 lines
276 B
Go
Raw Normal View History

2016-05-02 16:56:58 +00:00
package net_test
import (
"testing"
2016-08-20 18:55:45 +00:00
. "v2ray.com/core/common/net"
2016-05-02 16:56:58 +00:00
)
func TestPortRangeContains(t *testing.T) {
portRange := &PortRange{
2016-08-26 22:04:35 +00:00
From: 53,
To: 53,
2016-05-02 16:56:58 +00:00
}
2019-01-08 22:27:02 +00:00
if !portRange.Contains(Port(53)) {
t.Error("expected port range containing 53, but actually not")
}
2016-05-02 16:56:58 +00:00
}