| ... | @@ -27,7 +27,11 @@ test "simple test" { | ... | @@ -27,7 +27,11 @@ test "simple test" { |
| 27 | } | 27 | } |
| 28 | | 28 | |
| 29 | test "fuzz example" { | 29 | test "fuzz example" { |
| 30 | // Try passing `--fuzz` to `zig build test` and see if it manages to fail this test case! | 30 | const global = struct { |
| 31 | const input_bytes = std.testing.fuzzInput(.{}); | 31 | fn testOne(input: []const u8) anyerror!void { |
| 32 | try std.testing.expect(!std.mem.eql(u8, "canyoufindme", input_bytes)); | 32 | // Try passing `--fuzz` to `zig build test` and see if it manages to fail this test case! |
| | 33 | try std.testing.expect(!std.mem.eql(u8, "canyoufindme", input)); |
| | 34 | } |
| | 35 | }; |
| | 36 | try std.testing.fuzz(global.testOne, .{}); |
| 33 | } | 37 | } |