mirror of
https://github.com/asmogo/nws.git
synced 2024-12-13 02:46:22 +00:00
25 lines
332 B
Go
25 lines
332 B
Go
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")
|
|
}
|
|
}
|