1
0
Fork 0
forked from External/ergo
This commit is contained in:
Shivaram Lingamneni 2019-12-18 07:06:04 -05:00
parent ab444a3980
commit 91d6888b7e
5 changed files with 130 additions and 3 deletions

View file

@ -215,3 +215,25 @@ func TestCanonicalizeMaskWildcard(t *testing.T) {
tester("Shivaram*", "shivaram*!*@*", nil)
tester("*SHIVARAM*", "*shivaram*!*@*", nil)
}
func TestFoldPermissive(t *testing.T) {
tester := func(first, second string, equal bool) {
firstFolded, err := foldPermissive(first)
if err != nil {
panic(err)
}
secondFolded, err := foldPermissive(second)
if err != nil {
panic(err)
}
foundEqual := firstFolded == secondFolded
if foundEqual != equal {
t.Errorf("%s and %s: expected equality %t, but got %t", first, second, equal, foundEqual)
}
}
tester("SHIVARAM", "shivaram", true)
tester("shIvaram", "shivaraM", true)
tester("shivaram", "DAN-", false)
tester("dolph🐬n", "DOLPH🐬n", true)
tester("dolph🐬n", "dolph💻n", false)
}