aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCléo Rebert <cleo.rebert@gmail.com>2020-08-27 01:29:16 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-08-27 04:12:28 -0400
commitfc001110b4f4c271217ae6ce973c80a33925ca3b (patch)
treec86147b326ab6a1ce7f02a1741f6de2bfc6a9437 /lib
parent5fed721290cc7ecf396b7815f830e1fabe8b4711 (diff)
downloadzig-fc001110b4f4c271217ae6ce973c80a33925ca3b.tar.gz
zig-fc001110b4f4c271217ae6ce973c80a33925ca3b.zip
Added edge case test to mem.count
Some implementations break on this edge case. Thought relevant to add it.
Diffstat (limited to 'lib')
-rw-r--r--lib/std/mem.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/std/mem.zig b/lib/std/mem.zig
index e5c53bbb07..71190069a8 100644
--- a/lib/std/mem.zig
+++ b/lib/std/mem.zig
@@ -920,6 +920,7 @@ test "mem.count" {
testing.expect(count(u8, "foo bar", "o bar") == 1);
testing.expect(count(u8, "foofoofoo", "foo") == 3);
testing.expect(count(u8, "fffffff", "ff") == 3);
+ testing.expect(count(u8, "owowowu", "owowu") == 1);
}
/// Reads an integer from memory with size equal to bytes.len.