mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-25 07:20:44 +00:00
simplify testing
This commit is contained in:
1 parent
3582b9d869
commit
fc63f0432c
99 files changed
+726
-817
No files matched your search
@@ -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.")
|
||||
|
||||
Reference in new issue
Block a user