1 const std = @import("std");
2 const default = @import("default");
5 // Prints to stderr, ignoring potential errors.
6 std.debug.print("All your {s} are belong to us.\n", .{"codebaze"});
7 try default.bufferedPrint();
11 const gpa = std.testing.allocator;
12 var list: std.ArrayList(i32) = .empty;
13 defer list.deinit(gpa); // Try commenting this out and see if zig detects the memory leak!
14 try list.append(gpa, 42);
15 try std.testing.expectEqual(@as(i32, 42), list.pop());
19 const Context = struct {
20 fn testOne(context: @This(), input: []const u8) anyerror!void {
22 // Try passing `--fuzz` to `zig build test` and see if it manages to fail this test case!
23 try std.testing.expect(!std.mem.eql(u8, "canyoufindme", input));
26 try std.testing.fuzz(Context{}, Context.testOne, .{});