etcd/pkg/flags/proxy_test.go
Brandon Philips 78a9bba276 pkg/types/flags: introduce flags package
I want to use the Addrs type in another experimental proxy that I am
implementing. Pull it out into a separate package.
2014-09-28 14:56:30 -07:00

29 lines
414 B
Go

package flags
import (
"testing"
)
func TestProxySet(t *testing.T) {
tests := []struct {
val string
pass bool
}{
// known values
{"on", true},
{"off", true},
// unrecognized values
{"foo", false},
{"", false},
}
for i, tt := range tests {
pf := new(Proxy)
err := pf.Set(tt.val)
if tt.pass != (err == nil) {
t.Errorf("#%d: want pass=%t, but got err=%v", i, tt.pass, err)
}
}
}