diff options
Diffstat (limited to 'src/gui/gui.zig')
| -rw-r--r-- | src/gui/gui.zig | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 1e58d3ba..ea0e2862 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -5042,7 +5042,7 @@ test "a wheel's notch is whole lines, a touchpad's fraction is not" { try std.testing.expectEqual(@as(?i32, null), notchOf(std.math.nan(f32), 1)); } -test "a click over codex in a terminal reaches its pty with its modifiers; with Shift it is pardes's" { +test "a click over codex in a terminal reaches its pty with its modifiers; Shift swaps B1 to pardes and B2 to the program" { if (comptime !pardes.panes.terminal.enabled) return error.SkipZigTest; const gpa = std.testing.allocator; const core = try pardes.Pardes.init(gpa, .{ .cols = 60, .rows = 16, .tty_only = true }); @@ -5077,9 +5077,17 @@ test "a click over codex in a terminal reaches its pty with its modifiers; with try std.testing.expectEqualStrings("\x1b[<32;7;4M", try take(core, &sent)); in.post(.{ .mouse = pointerMouse(.left, .release, next, .{}) }); try std.testing.expectEqualStrings("\x1b[<0;7;4m", try take(core, &sent)); + // Shift-B1 is pardes's select; B2 is pardes's execute and Shift-B2 + // the program's, reported without the Shift. + in.post(.{ .mouse = pointerMouse(.left, .press, mc, .{ .shift = true }) }); + in.post(.{ .mouse = pointerMouse(.left, .release, mc, .{ .shift = true }) }); + try std.testing.expectEqualStrings("", try take(core, &sent)); + in.post(.{ .mouse = pointerMouse(.middle, .press, mc, .{}) }); + in.post(.{ .mouse = pointerMouse(.middle, .release, mc, .{}) }); + try std.testing.expectEqualStrings("", try take(core, &sent)); in.post(.{ .mouse = pointerMouse(.middle, .press, mc, .{ .shift = true }) }); in.post(.{ .mouse = pointerMouse(.middle, .release, mc, .{ .shift = true }) }); - try std.testing.expectEqualStrings("", try take(core, &sent)); + try std.testing.expectEqualStrings("\x1b[<1;6;4M\x1b[<1;6;4m", try take(core, &sent)); } test "a wheel over codex in a terminal reaches its pty as the mouse reports it asked for" { |
