Commit fc001110b4

Cléo Rebert <cleo.rebert@gmail.com>
2020-08-27 01:29:16
Added edge case test to mem.count
Some implementations break on this edge case. Thought relevant to add it.
1 parent 5fed721
Changed files (1)
lib
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.