1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-12 05:54:18 -04:00
v2fly/io/socks/socks_test.go

19 lines
416 B
Go
Raw Normal View History

2015-09-07 11:28:36 -04:00
package socks
import (
"testing"
)
func TestAuthenticationResponseToBytes(t *testing.T) {
2015-09-07 11:29:20 -04:00
socksVersion := uint8(5)
authMethod := uint8(1)
2015-09-07 11:28:36 -04:00
response := Socks5AuthenticationResponse{socksVersion, authMethod}
bytes := response.ToBytes()
if bytes[0] != socksVersion {
t.Errorf("Unexpected Socks version %d", bytes[0])
}
2015-09-07 11:29:20 -04:00
if bytes[1] != authMethod {
t.Errorf("Unexpected Socks auth method %d", bytes[1])
}
2015-09-07 11:28:36 -04:00
}