diff options
Diffstat (limited to 'test/pdf.zig')
| -rw-r--r-- | test/pdf.zig | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/pdf.zig b/test/pdf.zig index bf0bfae7..2f14fb2f 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -1760,7 +1760,7 @@ test "PDF native mouse selection, Look, and highlights share page geometry" { const query_before = try gpa.dupe(u8, pv.search_query); defer gpa.free(query_before); const search_hit_before = pv.search_hit; - const jumps_before = .{ p.njumps, p.jcur, p.n_look_src }; + const jumps_before = .{ p.jumps.n, p.jumps.cur, p.n_look_src }; const effects_before = p.effects_len; try std.testing.expect(p.drag == .none); @@ -1812,7 +1812,7 @@ test "PDF native mouse selection, Look, and highlights share page geometry" { try std.testing.expect(std.meta.eql(selection_head_before, pv.selection_head)); try std.testing.expectEqualStrings(query_before, pv.search_query); try std.testing.expectEqual(search_hit_before, pv.search_hit); - try std.testing.expectEqual(jumps_before, .{ p.njumps, p.jcur, p.n_look_src }); + try std.testing.expectEqual(jumps_before, .{ p.jumps.n, p.jumps.cur, p.n_look_src }); try std.testing.expectEqual(effects_before, p.effects_len); try std.testing.expect(p.drag == .none); } @@ -2032,15 +2032,15 @@ test "PDF Back and Forward clear selections and land on recorded pages" { const state = pane.pdf.?; try std.testing.expect(state.page_count > 1); try std.testing.expect(state.focusLocation(p.pdf_gpa, 2, 0)); - p.njumps = 2; - p.jcur = 1; - p.jumps[0] = .{ .pane = 0, .serial = pane.serial, .line = 1, .col = 0 }; - p.jumps[1] = .{ .pane = 0, .serial = pane.serial, .line = 2, .col = 0 }; + p.jumps.n = 2; + p.jumps.cur = 1; + p.jumps.list[0] = .{ .pane = 0, .serial = pane.serial, .line = 1, .col = 0 }; + p.jumps.list[1] = .{ .pane = 0, .serial = pane.serial, .line = 2, .col = 0 }; for ([_]u21{ 'o', 'i' }, 0..) |key, destination| { try std.testing.expectEqual(panes.Pdf.SelectionUpdate.changed, state.setSelection(p.pdf_gpa, .{ .x = 0, .y = 0 }, .{ .x = 1, .y = 1 }, true)); try std.testing.expect(state.selection != null and state.selection_text.len > 0); p.update(.{ .key = .{ .cp = key, .ctrl = true } }); - try std.testing.expectEqual(destination, p.jcur); + try std.testing.expectEqual(destination, p.jumps.cur); try std.testing.expectEqual(destination, state.page); try std.testing.expect(state.selection == null); try std.testing.expect(state.selection_page == null); @@ -2111,11 +2111,11 @@ test "a PDF's jumps: Back after a far jump returns to the exact offset, two plac try jumpFrame(p); try std.testing.expect(pv.page_count > 3); // Two places on page 1, more than a body apart: two entries. - const before = p.njumps; + const before = p.jumps.n; _ = try stripAtPlace(p, pane, 1, 0.05); const near = try stripAtPlace(p, pane, 1, 0.8); - try std.testing.expectEqual(before + 2, p.njumps); - try std.testing.expect(p.jumps[p.njumps - 1].pdf); + try std.testing.expectEqual(before + 2, p.jumps.n); + try std.testing.expect(p.jumps.list[p.jumps.n - 1].pdf); // A far jump (a Look at a page), then Back: the exact offset, not the // page's top, and its page. look.lookAt(p, id, if (pv.page_count > 3000) ":3000" else ":4"); @@ -2126,12 +2126,12 @@ test "a PDF's jumps: Back after a far jump returns to the exact offset, two plac try std.testing.expectEqual(@as(usize, 1), pv.page); try std.testing.expectApproxEqAbs(near, pv.document_scroll_y, 0.5); // A wheel's small steps are the same visit: the entry follows them. - const n = p.njumps; + const n = p.jumps.n; for (0..4) |_| { _ = panes.Pdf.scrollPane(p, pane, 30, true); try jumpFrame(p); } - try std.testing.expectEqual(n, p.njumps); + try std.testing.expectEqual(n, p.jumps.n); } test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens at its place" { @@ -2167,7 +2167,7 @@ test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens a try p.removePane(doc, null); try jumpFrame(p); var closed = false; - for (p.jumps[0..p.njumps]) |j| closed = closed or (j.serial == 0 and j.pdf); + for (p.jumps.list[0..p.jumps.n]) |j| closed = closed or (j.serial == 0 and j.pdf); try std.testing.expect(closed); var tries: usize = 0; while (tries < 4) : (tries += 1) { |
