summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fs_namespace.zig4
-rw-r--r--test/kitty.zig4
-rw-r--r--test/pdf.zig34
-rw-r--r--test/pdf_pointer_bench.zig4
-rw-r--r--test/pdf_scroll_bench.zig2
5 files changed, 24 insertions, 24 deletions
diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig
index 00b2461a..d54eb9a2 100644
--- a/test/fs_namespace.zig
+++ b/test/fs_namespace.zig
@@ -89,7 +89,7 @@ test "transactional restore preserves host capabilities and advances pane identi
p.lsp_ask.seq = 41;
p.pipe.seq = 73;
if (@hasField(pardes.CellPixels, "w")) p.cell_pixels = .{ .w = 9, .h = 18 };
- p.native_images = true;
+ p.frontend.native_images = true;
p.fs.socket_path = "/tmp/session.sock";
p.fs.tcp_address = .{ .ip4 = .loopback(5640) };
try pardes.dump.dumpState(p);
@@ -98,7 +98,7 @@ test "transactional restore preserves host capabilities and advances pane identi
try std.testing.expectEqual(@as(u32, 41), restored.lsp_ask.seq);
try std.testing.expectEqual(@as(u32, 73), restored.pipe.seq);
try std.testing.expectEqual(p.cell_pixels, restored.cell_pixels);
- try std.testing.expect(restored.native_images);
+ try std.testing.expect(restored.frontend.native_images);
// The dump's pane, its serial too; a new one is past the old session's.
try std.testing.expectEqual(pane.serial, restored.panes[0].?.serial);
try std.testing.expect(restored.next_serial >= p.next_serial);
diff --git a/test/kitty.zig b/test/kitty.zig
index 5531242e..daa01060 100644
--- a/test/kitty.zig
+++ b/test/kitty.zig
@@ -71,7 +71,7 @@ const Rig = struct {
std.testing.log_level = .err;
// A core boots one shell or the classic three.
const p = try Pardes.init(gpa, .{ .cols = 120, .rows = 40, .shells = if (shells > 1) 3 else 1 });
- p.native_images = true;
+ p.frontend.native_images = true;
p.update(.{ .resize = .{ .cols = 120, .rows = 40, .cell_pixels = .{ .w = 10, .h = 20 } } });
for (p.panes) |slot| if (slot) |each| {
each.body.mode = .tty;
@@ -1310,7 +1310,7 @@ test "kitty: recorded kitten icat and chafa traffic replays: answers whole, imag
test "kitty: under a shell that draws no pixels, a 64x64 image over 8x4 cells is glyph art in every cell" {
var r = try Rig.init(1);
defer r.deinit();
- r.p.native_images = false;
+ r.p.frontend.native_images = false;
r.p.update(.{ .resize = .{ .cols = 120, .rows = 40, .cell_pixels = .{ .w = 8, .h = 16 } } });
r.drain();
// Not the frame's arena: each frame resets that.
diff --git a/test/pdf.zig b/test/pdf.zig
index 2f14fb2f..b66db1df 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -45,7 +45,7 @@ const PdfLinkTests = struct {
const path = try std.fmt.allocPrint(std.testing.allocator, "{s}/links.pdf", .{dir_buf[0..len]});
defer std.testing.allocator.free(path);
const p = try Pardes.init(std.testing.allocator, .{ .file = path, .cols = 100, .rows = 36 });
- p.native_images = true;
+ p.frontend.native_images = true;
p.panes[0].?.pdf.?.fit = .height;
return p;
}
@@ -375,7 +375,7 @@ test "watched PDF reload replaces MuPDF state and preserves the reading view" {
const sections = p.panes[sections_id].?;
try std.testing.expect(sections.file.?.content.len > 0);
- p.native_images = true;
+ p.frontend.native_images = true;
state.fit = .height;
state.tint = .full;
state.pan_x = 1234;
@@ -492,7 +492,7 @@ test "PDF reload does not re-center an already revealed matching search" {
const path = try std.fmt.bufPrint(&path_buf, ".zig-cache/tmp/{s}/search.pdf", .{tmp.sub_path});
const p = try Pardes.init(gpa, .{ .file = path, .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const state = pane.pdf.?;
try state.setSearchQuery(p.pdf_gpa, "Pardes");
@@ -559,7 +559,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" {
try std.testing.expectEqualStrings(expected_tag, initial_tag);
try std.testing.expect(std.mem.endsWith(u8, initial_tag, pane_tail));
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
const first = try p.render(frame.allocator());
@@ -889,7 +889,7 @@ test "a fling's banded pages show the reader exactly what whole pages would" {
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .file = "docs/design.pdf", .cols = 120, .rows = 40 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const pv = pane.pdf.?;
var frame = std.heap.ArenaAllocator.init(gpa);
@@ -993,7 +993,7 @@ test "a tall page is drawn at the display's resolution, in bands that are the wh
defer gpa.free(path);
const p = try Pardes.init(gpa, .{ .file = path, .cols = 120, .rows = 40 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const pv = pane.pdf.?;
var frame = std.heap.ArenaAllocator.init(gpa);
@@ -1154,7 +1154,7 @@ test "Escape cancels PDF chrome in place, then leaves the pane; Shift-Escape lea
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
// A second pane, then focus it and come back: `Last` has somewhere to go
// and the PDF is where the keys land.
@@ -1214,7 +1214,7 @@ test "Escape cancels PDF chrome in place, then leaves the pane; Shift-Escape lea
try std.testing.expect(pv.selection != null);
// A text-only page shows neither: one Escape drops them and goes.
- p.native_images = false;
+ p.frontend.native_images = false;
p.update(.{ .key = .{ .cp = Key.escape } });
try std.testing.expectEqual(@as(usize, 0), p.active);
try pv.setSearchQuery(p.pdf_gpa, "Pardes");
@@ -1236,7 +1236,7 @@ test "PDF continuous strip renders every intersecting short page" {
const pane = p.panes[0].?;
const pv = pane.pdf.?;
try std.testing.expect(pv.page_count > 3);
- p.native_images = true;
+ p.frontend.native_images = true;
// A legal wide MediaBox can make more than three pages intersect one
// viewport. Seed tiny matching rasters so this tests transport/cache
@@ -1310,7 +1310,7 @@ test "PDF tint and tinted theme changes rebuild every visible raster only" {
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
@@ -1433,7 +1433,7 @@ test "PDF resize preserves page-relative document position" {
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
@@ -1484,7 +1484,7 @@ test "PDF pane geometry change preserves its page-relative position" {
p.sync(); // rects for the new column, exactly as the two-pane boot did
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
@@ -1536,7 +1536,7 @@ test "PDF n/N addresses and reveals distinct MuPDF hits on one page" {
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var page_hits = try pv.document.search(gpa, 0, "Pardes");
defer page_hits.deinit(gpa);
@@ -1656,7 +1656,7 @@ test "PDF native mouse selection, Look, and highlights share page geometry" {
try std.testing.expect(pane.pdf.?.selection == null);
pane.sel[sel_slot].state = .none;
- p.native_images = true;
+ p.frontend.native_images = true;
_ = frame.reset(.retain_capacity);
const plain = try p.render(frame.allocator());
const plain_revision = plain.images.items[0].native.revision;
@@ -2027,7 +2027,7 @@ test "PDF Back and Forward clear selections and land on recorded pages" {
if (!pdf_enabled) return error.SkipZigTest;
const p = try Pardes.init(std.testing.allocator, .{ .file = "docs/design.pdf", .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const state = pane.pdf.?;
try std.testing.expect(state.page_count > 1);
@@ -2104,7 +2104,7 @@ test "a PDF's jumps: Back after a far jump returns to the exact offset, two plac
if (!pdf_enabled) return error.SkipZigTest;
const p = try Pardes.init(std.testing.allocator, .{ .file = jumpPdf(), .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const id = p.active;
const pane = p.panes[id].?;
const pv = pane.pdf.?;
@@ -2144,7 +2144,7 @@ test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens a
const path = try std.fmt.bufPrint(&path_buf, "{s}/docs/design.pdf", .{cwd});
const p = try Pardes.init(std.testing.allocator, .{ .file = path, .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
try std.testing.expectEqual(config.Runtime.JumpScope.file, p.settings.jump_scope);
const doc = p.active;
const pane = p.panes[doc].?;
diff --git a/test/pdf_pointer_bench.zig b/test/pdf_pointer_bench.zig
index 573b8766..d6cf0e19 100644
--- a/test/pdf_pointer_bench.zig
+++ b/test/pdf_pointer_bench.zig
@@ -156,8 +156,8 @@ fn verify(core: *pardes.Pardes, arena: std.mem.Allocator) !void {
fn measure(config: Config, round: usize) !u64 {
const core = try pardes.Pardes.init(gpa, .{ .file = config.path, .cols = cols, .rows = rows });
defer core.deinit();
- core.native_images = true;
- if (comptime @hasField(pardes.Pardes, "native_image_patches")) core.native_image_patches = config.live;
+ core.frontend.native_images = true;
+ if (comptime @hasField(pardes.Pardes, "native_image_patches")) core.frontend.native_image_patches = config.live;
var run: Run = .{ .core = core, .arena = .init(gpa), .config = config, .round = round };
defer run.arena.deinit();
const cell: pardes.CellPixels = .{ .w = config.cell_w, .h = config.cell_h };
diff --git a/test/pdf_scroll_bench.zig b/test/pdf_scroll_bench.zig
index 1a27b828..9ef11a1c 100644
--- a/test/pdf_scroll_bench.zig
+++ b/test/pdf_scroll_bench.zig
@@ -321,7 +321,7 @@ fn bootCore(config: Config) !*pardes.Pardes {
.rows = bench_rows,
});
errdefer core.deinit();
- core.native_images = true;
+ core.frontend.native_images = true;
core.update(.{ .resize = .{
.cols = bench_cols,
.rows = bench_rows,