(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func 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 | |
| 34 | func TestSetFromArray(t *testing.T) { |
| 35 | cases := [][][]string{ |
nothing calls this directly
no test coverage detected