summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 0379a03d..996accf1 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -587,6 +587,7 @@ const BodyHitTests = struct {
pane.scrollBy(10);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
+ p.sync();
_ = try p.render(frame.allocator());
const layer = &p.surface.body_layers[0];
try std.testing.expect(layer.context_rows >= 4);
@@ -635,6 +636,7 @@ const LineNumberLookTests = struct {
pane.scrollBy(30);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
+ p.sync();
_ = try p.render(frame.allocator());
const layer = &p.surface.body_layers[0];
try std.testing.expect(layer.context_rows >= 2);
@@ -693,6 +695,7 @@ const TreeContextTests = struct {
pane.scrollBy(10);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
+ p.sync();
_ = try p.render(frame.allocator());
const layer = &p.surface.body_layers[0];
try std.testing.expectEqual(@as(u16, 4), layer.context_rows);
@@ -747,9 +750,11 @@ const TreeContextTests = struct {
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
pane.scrollBy(7);
+ p.sync();
_ = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 0), pane.context_rows);
try std.testing.expect(p.executeBuiltinLine(0, "TreeContext"));
+ p.sync();
_ = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 4), pane.context_rows);
for (0..4) |row| try std.testing.expectEqual(@as(i32, @intCast(row)), pane.wrapAt(@intCast(row)).line);
@@ -803,6 +808,7 @@ const TreeContextTests = struct {
pane.hscroll = 4;
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
+ p.sync();
const surface = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 3), pane.context_rows);
const rect = p.rects[0];
@@ -822,6 +828,7 @@ const TreeContextTests = struct {
// builtin above put up, so the body moved with it.
try std.testing.expectEqual(p.bodyTop(pane, p.rects[0]), cursor.y);
panes.File.setContent(p, &pane.file.?, try p.gpa.dupe(u8, std.mem.asBytes(&@as([18][28]u8, @splat("// no enclosing declaration\n".*)))));
+ p.sync();
_ = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 0), pane.context_rows);
try std.testing.expectEqual(pane.scroll(), pane.wrapAt(0).line);
@@ -840,6 +847,7 @@ const TreeContextTests = struct {
pane.scrollBy(2);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
+ p.sync();
const surface = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 1), pane.context_rows);
try std.testing.expectEqual(@as(i32, 2), pane.wrapAt(1).line);
@@ -2871,7 +2879,7 @@ const OutputTests = struct {
if (w.line == 0 and w.pad > 0 and w.at < file.location_rows[0].location_end) break vr;
} else return error.MissingWrappedLocation;
const w = result.wrapAt(@intCast(wrapped));
- const shown = try panes.File.bodyText(frame.allocator(), result, file, true);
+ const shown = try panes.File.bodyText(frame.allocator(), result, file);
const shown_line = modal.lineSlice(shown, wrapped);
try std.testing.expect(std.mem.startsWith(u8, shown_line[panes.File.gutterWidth(result)..], "│ │ "));
const rect = p.rects[result_id];
@@ -4897,6 +4905,7 @@ test "Zig keywords keep every rendered byte colored across line-number widths" {
p.settings.colors = true;
p.settings.wrap = view.wrap;
p.presentation.enabled = false;
+ p.sync();
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
const surface = try p.render(frame.allocator());