1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-26 12:05:35 -05:00

massive refactoring against unit test lib

This commit is contained in:
Darien Raymond
2015-12-02 14:27:18 +00:00
parent cee85bdf26
commit 0a2e4343bc
44 changed files with 327 additions and 317 deletions

View File

@@ -4,11 +4,12 @@ import (
"encoding/json"
"testing"
"github.com/v2ray/v2ray-core/testing/unit"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestIntPort(t *testing.T) {
assert := unit.Assert(t)
v2testing.Current(t)
var portRange PortRange
err := json.Unmarshal([]byte("1234"), &portRange)
@@ -19,7 +20,7 @@ func TestIntPort(t *testing.T) {
}
func TestOverRangeIntPort(t *testing.T) {
assert := unit.Assert(t)
v2testing.Current(t)
var portRange PortRange
err := json.Unmarshal([]byte("70000"), &portRange)
@@ -30,7 +31,7 @@ func TestOverRangeIntPort(t *testing.T) {
}
func TestSingleStringPort(t *testing.T) {
assert := unit.Assert(t)
v2testing.Current(t)
var portRange PortRange
err := json.Unmarshal([]byte("\"1234\""), &portRange)
@@ -41,7 +42,7 @@ func TestSingleStringPort(t *testing.T) {
}
func TestStringPairPort(t *testing.T) {
assert := unit.Assert(t)
v2testing.Current(t)
var portRange PortRange
err := json.Unmarshal([]byte("\"1234-5678\""), &portRange)
@@ -52,7 +53,7 @@ func TestStringPairPort(t *testing.T) {
}
func TestOverRangeStringPort(t *testing.T) {
assert := unit.Assert(t)
v2testing.Current(t)
var portRange PortRange
err := json.Unmarshal([]byte("\"65536\""), &portRange)