programming-languages

Definition

Zig

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software. 1

Fuzzing

Example (0.14):


```zig
test "fuzz example" {
    const Context = struct {
        fn testOne(context: @This(), input: []const u8) anyerror!void {
            _ = context;
            // 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(Context{}, Context.testOne, .{});
}

Footnotes

  1. https://ziglang.org/