1
0
Fork 0

Adding credentials test

logger
Armon Dadgar 2014-01-23 11:12:28 -08:00
parent 99dd8cee1f
commit 6dd53a5bda
1 changed files with 24 additions and 0 deletions

24
credentials_test.go Normal file
View File

@ -0,0 +1,24 @@
package socks5
import (
"testing"
)
func TestStaticCredentials(t *testing.T) {
creds := StaticCredentials{
"foo": "bar",
"baz": "",
}
if !creds.Valid("foo", "bar") {
t.Fatalf("expect valid")
}
if !creds.Valid("baz", "") {
t.Fatalf("expect valid")
}
if creds.Valid("foo", "") {
t.Fatalf("expect invalid")
}
}