diff --git a/common/net/testing/unit/destination_test.go b/common/net/testing/unit/destination_test.go index cac58111..badffaf6 100644 --- a/common/net/testing/unit/destination_test.go +++ b/common/net/testing/unit/destination_test.go @@ -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") } diff --git a/proxy/socks/config/json/config_test.go b/proxy/socks/config/json/config_test.go index 2967ed32..a88697af 100644 --- a/proxy/socks/config/json/config_test.go +++ b/proxy/socks/config/json/config_test.go @@ -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() } diff --git a/proxy/socks/protocol/udp_test.go b/proxy/socks/protocol/udp_test.go index 774c2167..51f1f1a3 100644 --- a/proxy/socks/protocol/udp_test.go +++ b/proxy/socks/protocol/udp_test.go @@ -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")) } diff --git a/proxy/vmess/protocol/vmess_test.go b/proxy/vmess/protocol/vmess_test.go index 9651d46c..464c7122 100644 --- a/proxy/vmess/protocol/vmess_test.go +++ b/proxy/vmess/protocol/vmess_test.go @@ -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) {