aboutsummaryrefslogtreecommitdiff
path: root/examples/hello-zig/src/main.zig
diff options
context:
space:
mode:
authorDavid Czihak <git@dcz.at>2026-05-09 13:01:50 +0200
committerDavid Czihak <git@dcz.at>2026-05-09 13:01:50 +0200
commit4b6f66fd512c254b5a82220dc77411fe391dd258 (patch)
tree7d77d7966e9ad2e296986ea8cfeb607088028195 /examples/hello-zig/src/main.zig
parent64e9c56fc665972fdde5234c4fb2f2a882e237dc (diff)
Chore: Rework examples for thorough extension testing
Diffstat (limited to 'examples/hello-zig/src/main.zig')
-rw-r--r--examples/hello-zig/src/main.zig32
1 files changed, 0 insertions, 32 deletions
diff --git a/examples/hello-zig/src/main.zig b/examples/hello-zig/src/main.zig
deleted file mode 100644
index 74eb590..0000000
--- a/examples/hello-zig/src/main.zig
+++ /dev/null
@@ -1,32 +0,0 @@
-const std = @import("std");
-const hello_zig = @import("hello_zig");
-
-pub fn main() !void {
- var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
- defer arena.deinit();
-
- const allocator = arena.allocator();
- const args = try std.process.argsAlloc(allocator);
- const name = if (args.len > 1) args[1] else "Nova";
-
- var greeter = hello_zig.Greeter{
- .name = name,
- .punctuation = '!',
- };
-
- const stdout = std.fs.File.stdout().deprecatedWriter();
- try greeter.write(stdout, .verbose);
-
- const sample_values = [_]i32{ -3, -2, 0, 1, 2, 3, 4 };
- var squares = try hello_zig.collectEvenSquares(allocator, &sample_values);
- defer squares.deinit(allocator);
-
- std.debug.print("even squares: {any}\n", .{squares.items});
-}
-
-test "main module can compute a summary" {
- const greeting = try hello_zig.describeNumber(std.testing.allocator, 42);
- defer std.testing.allocator.free(greeting);
-
- try std.testing.expect(std.mem.startsWith(u8, greeting, "positive"));
-}