3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-06-17 04:07:29 +02:00
ergo/irc/metadata_test.go
thatcher-gaming 4dcbc48159
metadata-2 (#2273)
Initial implementation of draft/metadata-2
2025-06-15 04:06:45 -04:00

22 lines
440 B
Go

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)
}
}
}