mirror of https://github.com/Dreamacro/clash.git
Fix: test `DstPort` type
This commit is contained in:
parent
c70c08af96
commit
651a36964e
|
@ -550,7 +550,7 @@ func testPacketConnTimeout(t *testing.T, pc net.PacketConn) error {
|
||||||
func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||||
conn, err := proxy.DialContext(context.Background(), &C.Metadata{
|
conn, err := proxy.DialContext(context.Background(), &C.Metadata{
|
||||||
Host: localIP.String(),
|
Host: localIP.String(),
|
||||||
DstPort: "10001",
|
DstPort: 10001,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
@ -558,7 +558,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||||
|
|
||||||
conn, err = proxy.DialContext(context.Background(), &C.Metadata{
|
conn, err = proxy.DialContext(context.Background(), &C.Metadata{
|
||||||
Host: localIP.String(),
|
Host: localIP.String(),
|
||||||
DstPort: "10001",
|
DstPort: 10001,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
@ -571,7 +571,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||||
pc, err := proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
pc, err := proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
||||||
NetWork: C.UDP,
|
NetWork: C.UDP,
|
||||||
DstIP: localIP,
|
DstIP: localIP,
|
||||||
DstPort: "10001",
|
DstPort: 10001,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer pc.Close()
|
defer pc.Close()
|
||||||
|
@ -581,7 +581,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||||
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
||||||
NetWork: C.UDP,
|
NetWork: C.UDP,
|
||||||
DstIP: localIP,
|
DstIP: localIP,
|
||||||
DstPort: "10001",
|
DstPort: 10001,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer pc.Close()
|
defer pc.Close()
|
||||||
|
@ -591,7 +591,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||||
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
||||||
NetWork: C.UDP,
|
NetWork: C.UDP,
|
||||||
DstIP: localIP,
|
DstIP: localIP,
|
||||||
DstPort: "10001",
|
DstPort: 10001,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer pc.Close()
|
defer pc.Close()
|
||||||
|
@ -628,7 +628,7 @@ func benchmarkProxy(b *testing.B, proxy C.ProxyAdapter) {
|
||||||
|
|
||||||
conn, err := proxy.DialContext(context.Background(), &C.Metadata{
|
conn, err := proxy.DialContext(context.Background(), &C.Metadata{
|
||||||
Host: localIP.String(),
|
Host: localIP.String(),
|
||||||
DstPort: "10001",
|
DstPort: 10001,
|
||||||
})
|
})
|
||||||
require.NoError(b, err)
|
require.NoError(b, err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue