summaryrefslogtreecommitdiff
path: root/test/kitty.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/kitty.zig')
-rw-r--r--test/kitty.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/kitty.zig b/test/kitty.zig
index 7b5347e0..4341677e 100644
--- a/test/kitty.zig
+++ b/test/kitty.zig
@@ -66,7 +66,7 @@ const Rig = struct {
fn init(shells: u8) !Rig {
// f=100 decodes through wuffs, its resize through stb_image_resize,
// which the shells start at launch.
- pardes.TerminalImages.start(gpa);
+ pardes.Term.start(gpa);
// ghostty warns of every refused command; the refusals are the point.
std.testing.log_level = .err;
// A core boots one shell or the classic three.
@@ -86,7 +86,7 @@ const Rig = struct {
for (&r.read) |*b| b.deinit(gpa);
r.frame.deinit();
r.p.deinit();
- pardes.TerminalImages.stop();
+ pardes.Term.stop();
}
fn drain(r: *Rig) void {
@@ -642,14 +642,14 @@ test "kitty: an image follows its text when the shell scrolls, resizes and reflo
try std.testing.expectEqual(o.y + 2, (try r.placesOf(10))[0].dst.y);
// A narrower pane reflows the text; the image stays on its row.
const pane = r.pane(0);
- terminal.resizeGrid(pane, 40, pane.rows);
+ pane.resizeGrid(40, pane.rows);
const text = try terminal.screenTextAlloc(pane, r.frame.allocator());
var row: usize = 0;
var lines = std.mem.splitScalar(u8, text, '\n');
while (lines.next()) |line| : (row += 1) if (std.mem.startsWith(u8, line, "marker")) break;
const drawn = try r.placesOf(10);
try std.testing.expectEqual(@as(usize, 1), drawn.len);
- const viewport_top: usize = @intCast(terminal.gridOffset(pane));
+ const viewport_top: usize = pardes.Term.grid(pane.terminal).offset;
try std.testing.expectEqual(o.y + @as(u16, @intCast(row - viewport_top)), drawn[0].dst.y);
}
@@ -822,7 +822,7 @@ test "kitty: an animation's frames play" {
// Stopped (s=1), nothing more to wake for.
r.feed(0, apc("a=a,i=70,s=1,q=2", ""));
_ = try r.places();
- try std.testing.expectEqual(@as(?u64, null), terminal.animationDueMs(r.pane(0)));
+ try std.testing.expectEqual(@as(?u64, null), pardes.Term.due(r.pane(0).terminal.?));
}
test "kitty: a placement relative to another (P=, Q=) is drawn at its parent's cell plus H/V" {
@@ -1168,7 +1168,7 @@ fn fuzzRun(seed: u64, steps: usize, trace: bool) !bool {
r.p.update(.{ .resize = .{ .cols = cols, .rows = rows, .cell_pixels = .{ .w = 1 + rng.uintLessThan(u16, 30), .h = 1 + rng.uintLessThan(u16, 60) } } });
r.drain();
},
- 1 => terminal.resizeGrid(r.pane(0), 1 + rng.uintLessThan(u16, 120), 1 + rng.uintLessThan(u16, 40)),
+ 1 => r.pane(0).resizeGrid(1 + rng.uintLessThan(u16, 120), 1 + rng.uintLessThan(u16, 40)),
2, 3 => {
const drawn = try r.places();
if (trace) std.debug.print(" {d} places, {d} placements, {d} images\n", .{ drawn.len, r.placementCount(0), r.storage(0).images.count() });
@@ -1225,13 +1225,13 @@ test "kitty: scrolled back by pardes, an image shows on its row; scrolled forwar
r.feed(0, &nl);
try std.testing.expectEqual(@as(usize, 0), (try r.placesOf(20)).len);
// Back to the top of the history: the marker row is the body's first.
- terminal.scrollGrid(pane, -1000);
+ pardes.Term.scroll(pane.terminal.?, -1000);
const o = r.origin(0);
const drawn = try r.placesOf(20);
try std.testing.expectEqual(@as(usize, 1), drawn.len);
try std.testing.expectEqual(o.y, drawn[0].dst.y);
try std.testing.expectEqual(o.x + 6, drawn[0].dst.x);
- terminal.followOutput(pane);
+ pane.followOutput();
try std.testing.expectEqual(@as(usize, 0), (try r.placesOf(20)).len);
}