v2ray-core/common/net/port_test.go

19 lines
263 B
Go
Raw Normal View History

2016-05-02 18:56:58 +02:00
package net_test
import (
"testing"
2016-08-20 20:55:45 +02:00
. "v2ray.com/core/common/net"
2017-10-24 16:15:35 +02:00
. "v2ray.com/ext/assert"
2016-05-02 18:56:58 +02:00
)
func TestPortRangeContains(t *testing.T) {
2017-10-24 16:15:35 +02:00
assert := With(t)
2016-05-02 18:56:58 +02:00
portRange := &PortRange{
2016-08-27 00:04:35 +02:00
From: 53,
To: 53,
2016-05-02 18:56:58 +02:00
}
2017-10-24 16:15:35 +02:00
assert(portRange.Contains(Port(53)), IsTrue)
2016-05-02 18:56:58 +02:00
}