summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 8f0a352c..7b34192f 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -117,10 +117,13 @@ const TagLayerTests = struct {
for ([_]Kind{ .workspace, .column }) |kind| {
const id: usize = if (kind == .column) 1 else 0;
const header = try findLayer(p, kind, id);
- const x = @as(f32, @floatFromInt(header.viewport.x)) * 10 + 62.5 * 5;
+ // The own text after the header's computed words and a blank
+ // (UX K'2).
+ const lead: f32 = @floatFromInt(pardes.tagline.headerWords(p, if (kind == .column) .column else .workspace).len + 1);
+ const x = @as(f32, @floatFromInt(header.viewport.x)) * 10 + (lead + 62.5) * 5;
p.update(.{ .mouse = mouse(header, x, .press) });
p.update(.{ .mouse = mouse(header, x, .release) });
- try std.testing.expectEqual(@as(i32, 63), pardes.tagline.focusedHeader(p).?.cur_col);
+ try std.testing.expectEqual(@as(i32, @intFromFloat(lead + 63)), pardes.tagline.focusedHeader(p).?.cur_col);
if (kind == .column) try std.testing.expectEqual(@as(?usize, 1), p.headerColumn()) else try std.testing.expect(p.headerColumn() == null);
p.update(.{ .key = .{ .cp = Key.escape } });
}
@@ -2266,7 +2269,7 @@ const ImageTests = struct {
pardes.layout.placeNew(p, 0, 0, id, .doc);
_ = try p.render(p.scratch.allocator());
pane.addon.?.art = .{ .glyph = true, .palette = .terminal, .ascii = false };
- try std.testing.expectEqualStrings("img petscii:on palette:terminal ascii:off /tmp/picture.ppm", try pardes.tagline.tagPrefix(p, pane));
+ try std.testing.expectEqualStrings("img petscii:on palette:terminal ascii:off /tmp/picture.ppm", try pardes.tagline.pathPrefix(p, p.scratch.allocator(), pane));
}
test "an image's dump keeps its path, its renderer choices and its tag's tail, and reopens from the file; a file gone waits as a placeholder saying so" {