summaryrefslogtreecommitdiff
path: root/tests_sdl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-05 19:42:46 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit7988d9bc6e31210ff13994f18d5622dd57ba9341 (patch)
tree62138868db52638cbefb18086dc226810fad761a /tests_sdl.zig
parente36e946f9a56c4ab1d10cef3aace20fe7d274dfa (diff)
downloadpardes-7988d9bc6e31210ff13994f18d5622dd57ba9341.tar.gz
pardes-7988d9bc6e31210ff13994f18d5622dd57ba9341.zip
sdl: ui_sdl rework (380+ lines) + replay changes
Diffstat (limited to 'tests_sdl.zig')
-rw-r--r--tests_sdl.zig20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests_sdl.zig b/tests_sdl.zig
index 857fc0a2..4bb8ab96 100644
--- a/tests_sdl.zig
+++ b/tests_sdl.zig
@@ -94,6 +94,26 @@ pub fn main(init: std.process.Init) !void {
try expectChangedPixels(&hs, before, 1000, "SDL: Tutor visual delta was too small");
try hs.expectBrightRows(1, 8, 300, "SDL: Tutor pane did not render bright text in the top rows");
+ // Touch-gesture parity at the app boundary: in PARDES_TEST the SDL app is
+ // driven by vaxis.Parser reading stdin, so SDL_EVENT_FINGER_* is not part of
+ // this e2e path. Simulate the gesture result instead: a two-finger tap should
+ // become a middle-click, and middle-clicking the global "Tutor" word should
+ // execute the builtin and render the tutor pane.
+ {
+ var hs_mid = try Harness.init(gpa, io, exe.ptr, 24, 80);
+ defer hs_mid.deinit();
+ hs_mid.trace = config.trace;
+ try hs_mid.expectWaitForImage(8000, "SDL middle-click result: no initial frame");
+ try hs_mid.pump(1000);
+
+ var mid_before = try hs_mid.imageCopy();
+ defer mid_before.deinit(gpa);
+ try hs_mid.send("\x1b[<1;14;1M\x1b[<1;14;1m");
+ try hs_mid.expectWaitForChange(mid_before.hash(), 10000, "SDL middle-click result: Tutor did not visibly change the render");
+ try expectChangedPixels(&hs_mid, mid_before, 1000, "SDL middle-click result: Tutor visual delta was too small");
+ try hs_mid.expectBrightRows(1, 8, 300, "SDL middle-click result: Tutor pane did not render bright text in the top rows");
+ }
+
// Fresh app: terminal char-mode overlay is visible, can be edited, hides in
// raw tty, and returns after leaving tty. Every step is asserted through
// rendered pixels.