simplify testing

This commit is contained in:
v2ray committed 2016-05-24 21:55:46 +02:00
1 parent 3582b9d869
commit fc63f0432c
99 files changed
+726 -817

No files matched your search

+4 -5
View File
@@ -8,12 +8,11 @@ import (
"testing"
. "github.com/v2ray/v2ray-core/common/net"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestIPParsing(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
rawJson := "\"8.8.8.8\""
var address AddressJson
@@ -25,7 +24,7 @@ func TestIPParsing(t *testing.T) {
}
func TestDomainParsing(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
rawJson := "\"v2ray.com\""
var address AddressJson
@@ -33,11 +32,11 @@ func TestDomainParsing(t *testing.T) {
assert.Error(err).IsNil()
assert.Bool(address.Address.IsIPv4()).IsFalse()
assert.Bool(address.Address.IsDomain()).IsTrue()
assert.StringLiteral(address.Address.Domain()).Equals("v2ray.com")
assert.String(address.Address.Domain()).Equals("v2ray.com")
}
func TestInvalidAddressJson(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
rawJson := "1234"
var address AddressJson