mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
parent
0f5603eca2
commit
4dcbc48159
16 changed files with 660 additions and 3 deletions
21
irc/metadata_test.go
Normal file
21
irc/metadata_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package irc
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestKeyCheck(t *testing.T) {
|
||||
cases := []struct {
|
||||
input string
|
||||
isEvil bool
|
||||
}{
|
||||
{"ImNormal", false},
|
||||
{":imevil", true},
|
||||
{"key£with$not%allowed^chars", true},
|
||||
{"key.that:s_completely/normal-and.fine", false},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
if metadataKeyIsEvil(c.input) != c.isEvil {
|
||||
t.Errorf("%s should have returned %v. but it didn't. so that's not great", c.input, c.isEvil)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue