MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestIsValidChannel

Function TestIsValidChannel

channels/set_test.go:19–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestIsValidChannel(t *testing.T) {
20 valid := []string{"*", "**", "a", "a ", "a b", "a*b", "FOO", "123", "-z", "foo_bar", "Éclær", "z7_", "!", "Z∫•", "*!"}
21 for _, ch := range valid {
22 if !IsValidChannel(ch) {
23 t.Errorf("IsValidChannel(%q) should be true", ch)
24 }
25 }
26 invalid := []string{"", "*,*", "a,*", "a, ", "b,?", ",", "Z,∫•", "*,!"}
27 for _, ch := range invalid {
28 if IsValidChannel(ch) {
29 t.Errorf("IsValidChannel(%q) should be false", ch)
30 }
31 }
32}
33
34func TestSetFromArray(t *testing.T) {
35 cases := [][][]string{

Callers

nothing calls this directly

Calls 2

IsValidChannelFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected