1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

leveral serial.String in code

This commit is contained in:
Darien Raymond 2015-12-02 15:49:34 +00:00
parent 3c12469ae5
commit 36848af749
4 changed files with 7 additions and 7 deletions

View File

@ -14,7 +14,7 @@ func TestTCPDestination(t *testing.T) {
dest := v2net.NewTCPDestination(v2net.IPAddress([]byte{1, 2, 3, 4}, 80))
assert.Bool(dest.IsTCP()).IsTrue()
assert.Bool(dest.IsUDP()).IsFalse()
assert.StringLiteral(dest.String()).Equals("tcp:1.2.3.4:80")
assert.String(dest).Equals("tcp:1.2.3.4:80")
}
func TestUDPDestination(t *testing.T) {
@ -23,5 +23,5 @@ func TestUDPDestination(t *testing.T) {
dest := v2net.NewUDPDestination(v2net.IPAddress([]byte{0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88}, 53))
assert.Bool(dest.IsTCP()).IsFalse()
assert.Bool(dest.IsUDP()).IsTrue()
assert.StringLiteral(dest.String()).Equals("udp:[2001:4860:4860::8888]:53")
assert.String(dest).Equals("udp:[2001:4860:4860::8888]:53")
}

View File

@ -28,7 +28,7 @@ func TestDefaultIPAddress(t *testing.T) {
v2testing.Current(t)
socksConfig := jsonconfig.CreateConfig("socks", config.TypeInbound).(*SocksConfig)
assert.StringLiteral(socksConfig.IP().String()).Equals("127.0.0.1")
assert.String(socksConfig.IP()).Equals("127.0.0.1")
}
func TestIPAddressParsing(t *testing.T) {
@ -37,7 +37,7 @@ func TestIPAddressParsing(t *testing.T) {
var ipAddress IPAddress
err := json.Unmarshal([]byte("\"1.2.3.4\""), &ipAddress)
assert.Error(err).IsNil()
assert.StringLiteral(net.IP(ipAddress).String()).Equals("1.2.3.4")
assert.String(net.IP(ipAddress)).Equals("1.2.3.4")
}
func TestNoAuthConfig(t *testing.T) {
@ -48,7 +48,7 @@ func TestNoAuthConfig(t *testing.T) {
assert.Error(err).IsNil()
assert.Bool(config.IsNoAuth()).IsTrue()
assert.Bool(config.IsPassword()).IsFalse()
assert.StringLiteral(config.IP().String()).Equals("8.8.8.8")
assert.String(config.IP()).Equals("8.8.8.8")
assert.Bool(config.UDPEnabled).IsFalse()
}

View File

@ -31,6 +31,6 @@ func TestDomainAddressRequest(t *testing.T) {
assert.Error(err).IsNil()
assert.Byte(request.Fragment).Equals(1)
assert.StringLiteral(request.Address.String()).Equals("v2ray.com:80")
assert.String(request.Address).Equals("v2ray.com:80")
assert.Bytes(request.Data.Value).Equals([]byte("Actual payload"))
}

View File

@ -78,7 +78,7 @@ func TestVMessSerialization(t *testing.T) {
assert.Bytes(actualRequest.RequestKey).Named("RequestKey").Equals(request.RequestKey[:])
assert.Bytes(actualRequest.ResponseHeader).Named("ResponseHeader").Equals(request.ResponseHeader[:])
assert.Byte(actualRequest.Command).Named("Command").Equals(request.Command)
assert.StringLiteral(actualRequest.Address.String()).Named("Address").Equals(request.Address.String())
assert.String(actualRequest.Address).Named("Address").Equals(request.Address.String())
}
func TestReadSingleByte(t *testing.T) {