mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 17:46:58 -05:00
Test case for auth response tobytes
This commit is contained in:
parent
bec765a2fe
commit
07b440fdcb
18
io/socks/socks_test.go
Normal file
18
io/socks/socks_test.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package socks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAuthenticationResponseToBytes(t *testing.T) {
|
||||||
|
socksVersion := uint8(5)
|
||||||
|
authMethod := uint8(1)
|
||||||
|
response := Socks5AuthenticationResponse{socksVersion, authMethod}
|
||||||
|
bytes := response.ToBytes()
|
||||||
|
if bytes[0] != socksVersion {
|
||||||
|
t.Errorf("Unexpected Socks version %d", bytes[0])
|
||||||
|
}
|
||||||
|
if bytes[1] != authMethod {
|
||||||
|
t.Errorf("Unexpected Socks auth method %d", bytes[1])
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user