summaryrefslogtreecommitdiff
path: root/test/hxdiff.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/hxdiff.zig')
-rw-r--r--test/hxdiff.zig14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/hxdiff.zig b/test/hxdiff.zig
index 48c7ab93..b12bcd8e 100644
--- a/test/hxdiff.zig
+++ b/test/hxdiff.zig
@@ -39,7 +39,7 @@ pub fn main(init: std.process.Init) !void {
var pane_override: ?[]const u8 = null;
var goldens_path: ?[]const u8 = null;
var waivers_path: ?[]const u8 = null;
- const paths = try arena.alloc([]const u8, args.len - 1);
+ const paths = try arena.alloc([]const u8, @max(args.len - 1, 3)); // room for the defaults below
var n_paths: usize = 0;
var want_waivers = false;
for (args[1..]) |a| {
@@ -67,6 +67,18 @@ pub fn main(init: std.process.Init) !void {
n_paths += 1;
}
}
+ // Named nothing (`zig build hxdiff` or `hxparity` bare): the checked-in
+ // suite, run from the repository root.
+ if (n_paths == 0 and !want_waivers) {
+ strict = true;
+ const defaults: []const []const u8 = if (parity)
+ &.{ "test/hxcases/cases.jsonl", "test/hxcases/parity.jsonl" }
+ else
+ &.{ "test/hxcases/cases.jsonl", "test/hxcases/goldens.jsonl", "test/hxcases/waivers.jsonl" };
+ if (parity) waivers_path = waivers_path orelse "test/hxcases/parity-waivers.jsonl";
+ @memcpy(paths[0..defaults.len], defaults);
+ n_paths = defaults.len;
+ }
if (n_paths == 0 or want_waivers)
fatal("usage: pardes-hxdiff [--parity] <cases.jsonl>... [goldens.jsonl [waivers.jsonl]]", .{});
const case_paths = paths[0..if (parity) n_paths else 1];