diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/panes.zig | 11 | ||||
| -rw-r--r-- | test/snapshots/tagnav.golden | 4 |
2 files changed, 13 insertions, 2 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()); diff --git a/test/snapshots/tagnav.golden b/test/snapshots/tagnav.golden index e7c6eca4..8b6752bd 100644 --- a/test/snapshots/tagnav.golden +++ b/test/snapshots/tagnav.golden @@ -37,9 +37,11 @@ == snap topbar-exec grid=100x31 cursor=7,4 |0: Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit Restore /tmp/pardes-sn |4: 1 alpha Dump ls -== snap topbar-restore-word grid=100x31 cursor=78,0 +== snap topbar-restore-word grid=100x31 cursor=60,0 +|0: d Grep Help Changelog Tutor Dump Themes Config Debug Exit Restore /tmp/pardes-snap/tagnav/dump.zon |4: 1 alpha ls == snap topbar-restored grid=100x31 cursor=7,4 +|0: Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit Restore /tmp/pardes-sn |4: 1 alpha $ ls |6: 3 gamma $ |7: /tmp/pardes-snap/tagnav/cwd Tty+bash Save Mode F ── restored history ── |
