aboutsummaryrefslogtreecommitdiff
path: root/src/strings/strings_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings/strings_test.go')
-rw-r--r--src/strings/strings_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go
index 5143ec86c9..f93cf6842f 100644
--- a/src/strings/strings_test.go
+++ b/src/strings/strings_test.go
@@ -1535,6 +1535,17 @@ func TestContainsRune(t *testing.T) {
}
}
+func TestContainsFunc(t *testing.T) {
+ for _, ct := range ContainsRuneTests {
+ if ContainsFunc(ct.str, func(r rune) bool {
+ return ct.r == r
+ }) != ct.expected {
+ t.Errorf("ContainsFunc(%q, func(%q)) = %v, want %v",
+ ct.str, ct.r, !ct.expected, ct.expected)
+ }
+ }
+}
+
var EqualFoldTests = []struct {
s, t string
out bool