Moving from govendor to dep, updated dependencies (#48)
* Moving from govendor to dep. * Making the pull request template more friendly. * Fixing akward space in PR template. * goimports run on whole project using ` goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./gen-go/*")` source of command: https://gist.github.com/bgentry/fd1ffef7dbde01857f66
This commit is contained in:
parent
9631aa3aab
commit
8d445c1c77
2186 changed files with 400410 additions and 352 deletions
53
vendor/github.com/samuel/go-zookeeper/zk/util_test.go
generated
vendored
Normal file
53
vendor/github.com/samuel/go-zookeeper/zk/util_test.go
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
package zk
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFormatServers(t *testing.T) {
|
||||
t.Parallel()
|
||||
servers := []string{"127.0.0.1:2181", "127.0.0.42", "127.0.42.1:8811"}
|
||||
r := []string{"127.0.0.1:2181", "127.0.0.42:2181", "127.0.42.1:8811"}
|
||||
for i, s := range FormatServers(servers) {
|
||||
if s != r[i] {
|
||||
t.Errorf("%v should equal %v", s, r[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidatePath(t *testing.T) {
|
||||
tt := []struct {
|
||||
path string
|
||||
seq bool
|
||||
valid bool
|
||||
}{
|
||||
{"/this is / a valid/path", false, true},
|
||||
{"/", false, true},
|
||||
{"", false, false},
|
||||
{"not/valid", false, false},
|
||||
{"/ends/with/slash/", false, false},
|
||||
{"/sequential/", true, true},
|
||||
{"/test\u0000", false, false},
|
||||
{"/double//slash", false, false},
|
||||
{"/single/./period", false, false},
|
||||
{"/double/../period", false, false},
|
||||
{"/double/..ok/period", false, true},
|
||||
{"/double/alsook../period", false, true},
|
||||
{"/double/period/at/end/..", false, false},
|
||||
{"/name/with.period", false, true},
|
||||
{"/test\u0001", false, false},
|
||||
{"/test\u001f", false, false},
|
||||
{"/test\u0020", false, true}, // first allowable
|
||||
{"/test\u007e", false, true}, // last valid ascii
|
||||
{"/test\u007f", false, false},
|
||||
{"/test\u009f", false, false},
|
||||
{"/test\uf8ff", false, false},
|
||||
{"/test\uffef", false, true},
|
||||
{"/test\ufff0", false, false},
|
||||
}
|
||||
|
||||
for _, tc := range tt {
|
||||
err := validatePath(tc.path, tc.seq)
|
||||
if (err != nil) == tc.valid {
|
||||
t.Errorf("failed to validate path %q", tc.path)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue