go-socks5/credentials_test.go

19 lines
321 B
Go
Raw Normal View History

2014-01-23 19:12:28 +00:00
package socks5
import (
"testing"
2020-08-05 06:40:07 +00:00
"github.com/stretchr/testify/assert"
2014-01-23 19:12:28 +00:00
)
func TestStaticCredentials(t *testing.T) {
creds := StaticCredentials{
"foo": "bar",
"baz": "",
}
2020-08-05 06:40:07 +00:00
assert.True(t, creds.Valid("foo", "bar", ""))
assert.True(t, creds.Valid("baz", "", ""))
assert.False(t, creds.Valid("foo", "", ""))
2014-01-23 19:12:28 +00:00
}