go-socks5/ruleset_test.go

22 lines
359 B
Go
Raw Normal View History

2014-01-23 19:15:53 +00:00
package socks5
import (
"testing"
)
func TestPermitCommand(t *testing.T) {
r := &PermitCommand{true, false, false}
if !r.AllowConnect(nil, 500, nil, 1000) {
t.Fatalf("expect connect")
}
if r.AllowBind(nil, 500, nil, 1000) {
t.Fatalf("do not expect bind")
}
if r.AllowAssociate(nil, 500, nil, 1000) {
t.Fatalf("do not expect associate")
}
}