From 6b4b1f76bb6bf969fb5106f95fb3f9ad077fac08 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 3 Jul 2026 15:17:46 -0300 Subject: fixing mouse drag on web --- tests.zig | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'tests.zig') diff --git a/tests.zig b/tests.zig index 7e44ddb7..ebcc12df 100644 --- a/tests.zig +++ b/tests.zig @@ -101,6 +101,46 @@ fn writeReplayScrollFixture(io: std.Io, gpa: std.mem.Allocator, path: []const u8 }); } +fn writeReplayHoverFixture(io: std.Io, gpa: std.mem.Allocator, path: []const u8) !void { + const panes = [_]dump.Pane{ + .{ + .kind = .file, + .tag = "nm /tmp/replay_left.txt Save Del", + .body = "", + .cols = 48, + .rows = 22, + .file = .{ + .path = "/tmp/replay_left.txt", + .content = "left\n", + }, + }, + .{ + .kind = .file, + .tag = "nm /tmp/replay_right.txt Save Del", + .body = "", + .cols = 48, + .rows = 22, + .file = .{ + .path = "/tmp/replay_right.txt", + .content = "right\n", + }, + }, + }; + const left_col = [_]usize{0}; + const right_col = [_]usize{1}; + const columns = [_]dump.Column{ + .{ .weight = 1, .panes = &left_col }, + .{ .weight = 1, .panes = &right_col }, + }; + try dump.writeFile(io, gpa, path, .{ + .screen = .{ .cols = 100, .rows = 24 }, + .topbar = "Kill Newcol Tutor Debug Colors NextColor Dump", + .theme = "dark", + .columns = &columns, + .panes = &panes, + }); +} + fn writeReplayImageFixture(io: std.Io, gpa: std.mem.Allocator, path: []const u8) !void { const png_b64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/p9sAAAAASUVORK5CYII="; const panes = [_]dump.Pane{.{ @@ -211,6 +251,17 @@ pub fn main(init: std.process.Init) !void { try replay_file.expectContains(" 1 const std", "replay file pane line numbers are broken"); try replay_file.expectNotContains("\xc2\xaa", "replay file line numbers used invalid stack bytes"); } + { + const fixture_path = "/tmp/pardes-replay-hover.zon"; + try writeReplayHoverFixture(io, gpa, fixture_path); + var replay_hover = try Harness.initArgs(gpa, replay_exe.ptr, 24, 100, fixture_path); + replay_hover.trace = config.trace; + defer replay_hover.deinit(); + try replay_hover.pump(1200); + try replay_hover.send("\x1b[<35;50;10M"); + try replay_hover.pump(400); + try replay_hover.expectContains("╎", "replay hover did not overlay the dashed resize handle"); + } { const fixture_path = "/tmp/pardes-replay-scroll-fixture.zon"; try writeReplayScrollFixture(io, gpa, fixture_path); -- cgit v1.3