diff options
Diffstat (limited to 'src/strings/strings_test.go')
| -rw-r--r-- | src/strings/strings_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go index d8fcb62a87..876f06c674 100644 --- a/src/strings/strings_test.go +++ b/src/strings/strings_test.go @@ -1379,6 +1379,8 @@ var EqualFoldTests = []struct { {"abcdefghijK", "abcdefghij\u212A", true}, {"abcdefghijkz", "abcdefghij\u212Ay", false}, {"abcdefghijKz", "abcdefghij\u212Ay", false}, + {"1", "2", false}, + {"utf-8", "US-ASCII", false}, } func TestEqualFold(t *testing.T) { @@ -1392,6 +1394,16 @@ func TestEqualFold(t *testing.T) { } } +func BenchmarkEqualFold(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tt := range EqualFoldTests { + if out := EqualFold(tt.s, tt.t); out != tt.out { + b.Fatal("wrong result") + } + } + } +} + var CountTests = []struct { s, sep string num int |
