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

+6 -7
View File
@@ -17,12 +17,11 @@ import (
proxytesting "github.com/v2ray/v2ray-core/proxy/testing"
proxymocks "github.com/v2ray/v2ray-core/proxy/testing/mocks"
"github.com/v2ray/v2ray-core/shell/point"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestSocksTcpConnect(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
port := v2nettesting.PickPort()
connInput := []byte("The data to be returned to socks server.")
@@ -82,11 +81,11 @@ func TestSocksTcpConnect(t *testing.T) {
assert.Bytes([]byte(data2Send)).Equals(connOutput.Bytes())
assert.Bytes(dataReturned).Equals(connInput)
assert.StringLiteral(targetServer).Equals(och.Destination.NetAddr())
assert.String(targetServer).Equals(och.Destination.NetAddr())
}
func TestSocksTcpConnectWithUserPass(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
port := v2nettesting.PickPort()
connInput := []byte("The data to be returned to socks server.")
@@ -149,11 +148,11 @@ func TestSocksTcpConnectWithUserPass(t *testing.T) {
assert.Bytes([]byte(data2Send)).Equals(connOutput.Bytes())
assert.Bytes(dataReturned).Equals(connInput)
assert.StringLiteral(targetServer).Equals(och.Destination.NetAddr())
assert.String(targetServer).Equals(och.Destination.NetAddr())
}
func TestSocksTcpConnectWithWrongUserPass(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
port := v2nettesting.PickPort()
connInput := []byte("The data to be returned to socks server.")
@@ -206,7 +205,7 @@ func TestSocksTcpConnectWithWrongUserPass(t *testing.T) {
}
func TestSocksTcpConnectWithWrongAuthMethod(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
port := v2nettesting.PickPort()
connInput := []byte("The data to be returned to socks server.")