diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-03 15:17:46 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | 6b4b1f76bb6bf969fb5106f95fb3f9ad077fac08 (patch) | |
| tree | 423fa58bc169d44d7581ab50970f154e962646ab /tests.zig | |
| parent | d1ed5bd8f55935e6470c4a7559216119571a084f (diff) | |
| download | pardes-6b4b1f76bb6bf969fb5106f95fb3f9ad077fac08.tar.gz pardes-6b4b1f76bb6bf969fb5106f95fb3f9ad077fac08.zip | |
fixing mouse drag on web
Diffstat (limited to 'tests.zig')
| -rw-r--r-- | tests.zig | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -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{.{ @@ -212,6 +252,17 @@ pub fn main(init: std.process.Init) !void { 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); var replay_scroll = try Harness.initArgs(gpa, replay_exe.ptr, 24, 80, fixture_path); |
