From 31d03a893a24f660136dcf1b70c5217905844198 Mon Sep 17 00:00:00 2001 From: v2ray Date: Mon, 2 May 2016 18:56:58 +0200 Subject: [PATCH] test case for port range --- common/net/port_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 common/net/port_test.go diff --git a/common/net/port_test.go b/common/net/port_test.go new file mode 100644 index 00000000..d1570a4d --- /dev/null +++ b/common/net/port_test.go @@ -0,0 +1,19 @@ +package net_test + +import ( + "testing" + + . "github.com/v2ray/v2ray-core/common/net" + v2testing "github.com/v2ray/v2ray-core/testing" + "github.com/v2ray/v2ray-core/testing/assert" +) + +func TestPortRangeContains(t *testing.T) { + v2testing.Current(t) + + portRange := &PortRange{ + From: Port(53), + To: Port(53), + } + assert.Bool(portRange.Contains(Port(53))).IsTrue() +}