From de4def3548a6729b0dfd2120495a61beef8c8c2c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 5 Jul 2026 20:21:50 -0300 Subject: pardes v2: the rewrite, complete and organized. src/ (core + three shells), test/ (snapshot parity harness + 18 frozen goldens). One sans-IO core, vaxis tty + SDL3 GPU native + wasm web shells, 18/18 parity with the purged prototype, 7.6k lines vs 12.1k. Fix: gui shell pre-sized the core at init so the greet-releasing resize never fired (blank panes until first interaction); live sessions now init at defaults and get the real grid as a resize event (the shell contract, documented on Options). --- test/snapshot.zig | 553 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 553 insertions(+) create mode 100644 test/snapshot.zig (limited to 'test/snapshot.zig') diff --git a/test/snapshot.zig b/test/snapshot.zig new file mode 100644 index 00000000..c1bf03c0 --- /dev/null +++ b/test/snapshot.zig @@ -0,0 +1,553 @@ +// pardes-snap: drive a pardes binary with a scripted input trace in a pty and +// capture the rendered grid at named sync points. The same script run against +// the prototype and the rewrite must produce byte-identical captures — this is +// the old-vs-new parity oracle for the rewrite. +// +// zig build snap run all snapshots/*.snap, diff goldens +// zig build snap -- --update regenerate goldens from this binary +// zig build snap -- snapshots/boot.snap one script +// +// Script commands (line-oriented, # comments): +// file create file in the script's cwd (before start) +// lines create file with n numbered lines +// dirmk create a subdirectory +// start [arg] fork the app in a pty (optional extra CLI arg) +// wait pump until needle appears on the grid (fails hard) +// settle pump for a fixed duration +// stable pump until the grid stops changing +// text send literal bytes +// send send with \e \r \n \t \\ \xNN escapes +// key enter esc tab bs space up down left right home end +// pgup pgdn c- a- (after esc: settle >=600ms, +// or vaxis parses the next byte as alt-) +// press|release SGR mouse, 1-based +// drag motion with button held +// motion button-less motion (hover) +// wheel +// resize +// snap