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

fully migrate to new assertion lib

This commit is contained in:
Darien Raymond
2017-10-24 16:15:35 +02:00
parent 4a0ca30d08
commit 74cf833758
70 changed files with 974 additions and 942 deletions

View File

@@ -7,23 +7,23 @@ import (
"strings"
"testing"
"v2ray.com/core/testing/assert"
. "v2ray.com/ext/assert"
"v2ray.com/core/testing/servers/tcp"
. "v2ray.com/core/transport/internet/tcp"
)
func TestGetOriginalDestination(t *testing.T) {
assert := assert.On(t)
assert := With(t)
tcpServer := tcp.Server{}
dest, err := tcpServer.Start()
assert.Error(err).IsNil()
assert(err, IsNil)
defer tcpServer.Close()
conn, err := Dial(context.Background(), dest)
assert.Error(err).IsNil()
assert(err, IsNil)
defer conn.Close()
originalDest, err := GetOriginalDestination(conn)
assert.Bool(dest == originalDest || strings.Contains(err.Error(), "failed to call getsockopt"))
assert(dest == originalDest || strings.Contains(err.Error(), "failed to call getsockopt"))
}