diff options
Diffstat (limited to 'test/panes.zig')
| -rw-r--r-- | test/panes.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/panes.zig b/test/panes.zig index f780a0cf..8b173ef4 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 } }); } |
