authorgravatar for cleo.rebert@gmail.comCléo Rebert <cleo.rebert@gmail.com> 2020-08-27 01:29:16+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-27 04:12:28-04:00
logfc001110b4f4c271217ae6ce973c80a33925ca3b
treec86147b326ab6a1ce7f02a1741f6de2bfc6a9437
parent5fed721290cc7ecf396b7815f830e1fabe8b4711

Added edge case test to mem.count

Some implementations break on this edge case. Thought relevant to add it.

1 files changed, 1 insertions(+), 0 deletions(-)

lib/std/mem.zig+1
...@@ -920,6 +920,7 @@ test "mem.count" {...@@ -920,6 +920,7 @@ test "mem.count" {
920 testing.expect(count(u8, "foo bar", "o bar") == 1);920 testing.expect(count(u8, "foo bar", "o bar") == 1);
921 testing.expect(count(u8, "foofoofoo", "foo") == 3);921 testing.expect(count(u8, "foofoofoo", "foo") == 3);
922 testing.expect(count(u8, "fffffff", "ff") == 3);922 testing.expect(count(u8, "fffffff", "ff") == 3);
923 testing.expect(count(u8, "owowowu", "owowu") == 1);
923}924}
924925
925/// Reads an integer from memory with size equal to bytes.len.926/// Reads an integer from memory with size equal to bytes.len.