mirror of
https://github.com/ergochat/ergo.git
synced 2025-06-17 04:07:29 +02:00
22 lines
440 B
Go
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)
|
|
}
|
|
}
|
|
}
|