From 7437a05c87c5313467a24d24468ea807a1413830 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 8 Nov 2026 23:17:01 -0300 Subject: tests: hxparity is hxdiff's --parity mode, one driver: the hxparity step goes, `zig build hxdiff -- --parity` runs the pty run against the file run as the step did (738 cases, 0 mismatches, 12 waived, its report still named hxparity), and the docs that named the step say so Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- build.zig | 13 +++---------- docs/helix-keys.md | 2 +- src/config.zig | 2 +- test/hxdiff.zig | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/build.zig b/build.zig index 35f4c55b..1491ed35 100644 --- a/build.zig +++ b/build.zig @@ -1310,10 +1310,11 @@ pub fn build(b: *std.Build) void { hxdiff.root_module.addImport("pardes", core_module); const run_hxdiff = b.addRunArtifact(hxdiff); run_hxdiff.has_side_effects = true; - // Bare, it runs the checked-in suite (test/hxdiff.zig). + // Bare, it runs the checked-in suite (test/hxdiff.zig); `-- --parity` + // runs each case in a file pane and a pty pane and compares the two. run_hxdiff.addPassthruArgs(); run_hxdiff.setCwd(b.path(".")); - const hxdiff_step = b.step("hxdiff", "compare Helix results (-- --strict cases reference [waivers]; cases alone emits)"); + const hxdiff_step = b.step("hxdiff", "compare Helix results (-- --strict cases reference [waivers]; cases alone emits; --parity: a pty pane against a file pane)"); hxdiff_step.dependOn(&run_hxdiff.step); const helix_harness = b.option([]const u8, "helix-harness", "path to the reference hx-harness executable") orelse @@ -1334,14 +1335,6 @@ pub fn build(b: *std.Build) void { update_reference.step.dependOn(&live_diff.step); b.step("hxdiff-update", "replace checked-in Helix goldens after the live comparison passes").dependOn(&update_reference.step); - const run_hxparity = b.addRunArtifact(hxdiff); - run_hxparity.has_side_effects = true; - run_hxparity.addArg("--parity"); - run_hxparity.addPassthruArgs(); - run_hxparity.setCwd(b.path(".")); - const hxparity_step = b.step("hxparity", "run the file-vs-pty editing parity suite (-- [--waivers w.jsonl] ...)"); - hxparity_step.dependOn(&run_hxparity.step); - // every helix-golf example, one case per step of its walkthrough const run_hxgolf = b.addRunArtifact(hxdiff); run_hxgolf.has_side_effects = true; diff --git a/docs/helix-keys.md b/docs/helix-keys.md index 0d9f38b7..f7a3093d 100644 --- a/docs/helix-keys.md +++ b/docs/helix-keys.md @@ -457,7 +457,7 @@ Run it: zig build hxdiff # cases + goldens + waivers, field-by-field; # unwaivered mismatch = per-case report + exit 1 zig build hxdiff -- test/hxcases/cases.jsonl # results to stdout, no diff - zig build hxparity # the SAME binary in --parity mode: cases.jsonl + zig build hxdiff -- --parity # --parity mode: cases.jsonl # + parity.jsonl, each case run twice over the # same text and keys (once in a file pane, once # in a pty pane), both result lines must match. diff --git a/src/config.zig b/src/config.zig index 3f9403a8..b9ddf07a 100644 --- a/src/config.zig +++ b/src/config.zig @@ -504,7 +504,7 @@ pub const messages_buffer = "+Messages"; pub const scratch_buffer = "+New"; pub const errors_buffer = "+Errors"; -// Modal bindings below are checked against Helix by hxdiff and hxparity. +// Modal bindings below are checked against Helix by hxdiff (and its --parity). pub const goto_prefix = 'g'; pub const view_prefix = 'z'; pub const view_prefix_sticky = 'Z'; diff --git a/test/hxdiff.zig b/test/hxdiff.zig index 7c72475f..90d486eb 100644 --- a/test/hxdiff.zig +++ b/test/hxdiff.zig @@ -66,7 +66,7 @@ pub fn main(init: std.process.Init) !void { n_paths += 1; } } - // Named nothing (`zig build hxdiff` or `hxparity` bare): the checked-in + // Named nothing (`zig build hxdiff`, `-- --parity` or not): the checked-in // suite, run from the repository root. if (n_paths == 0 and !want_waivers) { strict = true; -- cgit v1.3