From fc001110b4f4c271217ae6ce973c80a33925ca3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9o=20Rebert?= Date: Thu, 27 Aug 2020 01:29:16 +0200 Subject: [PATCH] Added edge case test to mem.count Some implementations break on this edge case. Thought relevant to add it. --- lib/std/mem.zig | 1 + 1 file changed, 1 insertion(+) 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.