mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
fix init template for new fuzz testing API
This commit is contained in:
parent
2d005827b8
commit
9dc75f03e2
1 changed files with 7 additions and 3 deletions
|
|
@ -27,7 +27,11 @@ test "simple test" {
|
||||||
}
|
}
|
||||||
|
|
||||||
test "fuzz example" {
|
test "fuzz example" {
|
||||||
// Try passing `--fuzz` to `zig build test` and see if it manages to fail this test case!
|
const global = struct {
|
||||||
const input_bytes = std.testing.fuzzInput(.{});
|
fn testOne(input: []const u8) anyerror!void {
|
||||||
try std.testing.expect(!std.mem.eql(u8, "canyoufindme", input_bytes));
|
// Try passing `--fuzz` to `zig build test` and see if it manages to fail this test case!
|
||||||
|
try std.testing.expect(!std.mem.eql(u8, "canyoufindme", input));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
try std.testing.fuzz(global.testOne, .{});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue