summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig26
1 files changed, 12 insertions, 14 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 001441a8..0a5674af 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -614,7 +614,7 @@ const TtySelectionTests = struct {
const pane = p.panes[0].?;
try std.testing.expectEqual(panes.Text.Mode.tty, pane.body.mode);
if (bracketed) p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?2004h" } });
- try std.testing.expectEqual(bracketed, panes.terminal.bracketedPaste(pane));
+ try std.testing.expectEqual(bracketed, pardes.Term.modes(pane.terminal).bracketed_paste);
try p.registers.put(p.gpa, '"', "one\ntwo", 0, 1, true); // what a `y` anywhere left behind
var buf: [256]u8 = undefined;
_ = childInput(p, &buf);
@@ -972,7 +972,7 @@ test "terminal overlay recoloring never materializes unrelated history" {
_ = try p.render(frame.allocator());
try testing.expect(p.shell_rows.pane == null);
- pane.ovl.?.row = panes.terminal.gridOffset(pane);
+ pane.ovl.?.row = @intCast(pardes.Term.grid(pane.terminal).offset);
p.gpa.free(pane.ovl.?.text);
pane.ovl.?.text = try p.gpa.dupe(u8, "caf\xc3\xa9 \xe7\x95\x8c");
_ = frame.reset(.retain_capacity);
@@ -1001,9 +1001,9 @@ test "terminal output keeps following new rows after scrollback eviction" {
for (0..3) |phase| {
if (phase > 0) {
pane.body.mode = .normal;
- panes.terminal.scrollGrid(pane, -30);
+ pardes.Term.scroll(pane.terminal.?, -30);
try std.testing.expect(pages.scrollbar().offset < pages.scrollbar().total - pane.rows);
- panes.terminal.enterTty(p, 0);
+ pardes.keys.enterTty(p, 0);
}
for (phase * 20_000..(phase + 1) * 20_000) |n| {
var buf: [64]u8 = undefined;
@@ -1123,7 +1123,7 @@ test "terminal edits and undo survive partial history clearing and whole-screen
if (action == .hidden_undo) {
gpa.free(pane.ovl.?.text);
pane.ovl = null;
- panes.terminal.enterTty(p, 0);
+ pardes.keys.enterTty(p, 0);
}
const bytes = switch (action) {
.clear_history, .partial_clear_history => "\x1b[3J",
@@ -1171,12 +1171,12 @@ test "terminal lower scroll regions do not move edits above them" {
pane.body.cur_row = 1;
pane.body.cur_pinned = true;
try panes.terminal.pushUndo(p, pane);
- const total = panes.terminal.scrollbar(pane).total;
+ const total = pardes.Term.grid(pane.terminal).total;
var setup: [64]u8 = undefined;
const bytes = try std.fmt.bufPrint(&setup, "\x1b[4;{d}r\x1b[{d};1H", .{ pane.rows, pane.rows });
p.update(.{ .output = .{ .pane = 0, .bytes = bytes } });
p.update(.{ .output = .{ .pane = 0, .bytes = std.mem.asBytes(&@as([50][6]u8, @splat("tail\r\n".*))) } });
- try std.testing.expectEqual(total, panes.terminal.scrollbar(pane).total);
+ try std.testing.expectEqual(total, pardes.Term.grid(pane.terminal).total);
try std.testing.expectEqual(@as(i32, 1), pane.ovl.?.row);
try std.testing.expectEqual(@as(i32, 1), pane.body.cur_row);
try std.testing.expectEqual(@as(i32, 1), pane.body.ed_undo[0].ovl.?.row);
@@ -2322,11 +2322,9 @@ const TerminalTests = struct {
// Tests asserting raw ANSI indices explicitly select helix, whose palette
// is inherited. Native-palette coverage lives in the overlay/eviction and
// trailing-blank tests and checks their concrete RGB values instead.
- const gridOffset = panes.terminal.gridOffset;
- const scrollGrid = panes.terminal.scrollGrid;
const promptInputReady = panes.terminal.promptInputReady;
- const forwardKey = panes.terminal.forwardKey;
- const enterTty = panes.terminal.enterTty;
+ const forwardKey = pardes.keys.forwardKey;
+ const enterTty = pardes.keys.enterTty;
// Align normal-mode glyphs with the VT grid and compare their styles.
fn modeStyleDiffs(p: *Pardes, pane: *Pane, gpa: std.mem.Allocator, note: []const u8) !usize {
@@ -2699,14 +2697,14 @@ const TerminalTests = struct {
p.update(.{ .output = .{ .pane = 0, .bytes = bytes } });
}
p.shell_rows.stale = true;
- scrollGrid(pane, -20);
+ pardes.Term.scroll(pane.terminal.?, -20);
// ONE buffer line standing in for SIX shell rows: everything below slides
// UP five, so the last rows of the body resolve past the viewport's bottom
// edge. `PageList.pin` answers for those rows anyway — it walks down the
// pagelist, not the viewport — so without a bound of its own this pass
// painted the scrollback's colours onto rows the text pass left blank.
- const anchor = gridOffset(pane);
+ const anchor: i32 = @intCast(pardes.Term.grid(pane.terminal).offset);
pane.ovl = .{ .row = anchor, .rows = 6, .text = try p.gpa.dupe(u8, "one") };
p.shell_rows.stale = true;
@@ -2971,7 +2969,7 @@ const TerminalTests = struct {
// a buffer whose covered span STRADDLES the viewport top is an ordinary
// state. tty mode does not apply the buffer, so it must not be moved by one
// either — and `surfRow`/`gridRow` are not inverses across that span.
- const anchor = gridOffset(pane);
+ const anchor: i32 = @intCast(pardes.Term.grid(pane.terminal).offset);
pane.ovl = .{ .row = anchor - 1, .rows = 4, .text = try p.gpa.dupe(u8, "one\ntwo") };
p.shell_rows.stale = true;
_ = frame.reset(.retain_capacity);