authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-01-01 20:52:25 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-01-01 20:52:25 -08:00
log1f19d4d7063527c03de16ca32e314c71df2cf1e8
tree032e04023ae730664fb1d7df7b93fd20d49aff8d
parentc16f7a7edabad11b623416805126af8ffeda0c06

add tests


2 files changed, 23 insertions(+), 0 deletions(-)

build.zig+12
......@@ -22,4 +22,16 @@ pub fn build(b: *std.Build) void {
2222
2323 const run_step = b.step("run", "Run the app");
2424 run_step.dependOn(&run_cmd.step);
25
26 const tests = b.addTest(.{
27 .root_source_file = b.path("test.zig"),
28 .target = target,
29 .optimize = mode,
30 });
31 deps.addAllTo(tests);
32
33 const test_step = b.step("test", "Run all library tests");
34 const tests_run = b.addRunArtifact(tests);
35 tests_run.has_side_effects = true;
36 test_step.dependOn(&tests_run.step);
2537}
test.zig created+11
......@@ -0,0 +1,11 @@
1const std = @import("std");
2const inquirer = @import("inquirer");
3
4test {
5 // ensure these have no compile errors
6 // but don't write anything to stdout/stderr
7 _ = &inquirer.answer;
8 _ = &inquirer.forEnum;
9 _ = &inquirer.forString;
10 _ = &inquirer.forConfirm;
11}