aboutsummaryrefslogtreecommitdiff
path: root/src/bytes/bytes_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytes/bytes_test.go')
-rw-r--r--src/bytes/bytes_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bytes/bytes_test.go b/src/bytes/bytes_test.go
index fc2824485a..05c0090b61 100644
--- a/src/bytes/bytes_test.go
+++ b/src/bytes/bytes_test.go
@@ -1847,6 +1847,17 @@ func TestContainsRune(t *testing.T) {
}
}
+func TestContainsFunc(t *testing.T) {
+ for _, ct := range ContainsRuneTests {
+ if ContainsFunc(ct.b, func(r rune) bool {
+ return ct.r == r
+ }) != ct.expected {
+ t.Errorf("ContainsFunc(%q, func(%q)) = %v, want %v",
+ ct.b, ct.r, !ct.expected, ct.expected)
+ }
+ }
+}
+
var makeFieldsInput = func() []byte {
x := make([]byte, 1<<20)
// Input is ~10% space, ~10% 2-byte UTF-8, rest ASCII non-space.