summaryrefslogtreecommitdiff
path: root/test/behaviour/other_files.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-03 17:04:29 -0300
committerGabriel Schneider <[email protected]>2026-11-03 17:05:58 -0300
commit5322d373c78ecee48b934886c95f3b8c4471a11f (patch)
tree9833d5871cc1cf838d13243943f43a5657cb5d6c /test/behaviour/other_files.zig
parent53c2a95eff9c67871d6004baa3e7d3c3b2a195fd (diff)
downloadpardes-5322d373c78ecee48b934886c95f3b8c4471a11f.tar.gz
pardes-5322d373c78ecee48b934886c95f3b8c4471a11f.zip
test: five of test/pdf.zig's tests through the 9P tree alone: a PDF's body a line for each line of its page's text (panes), PdfTint stepped in its ctl and never in its tag, refused at another pane (panes), PdfSections on a PDF with no outline opening nothing (panes, a PDF written by the test), /recent keeping a PDF open then closed (other_files), the pages a PDF shown as text turns for j/k, Ctrl-d/u/f/b, ge, gg, 3gg, 2G and the editing keys consumed (keys, a new file); the parts with no surface stay as two small tests (tint colours of a theme with none, `:`/SPC/`/` on a PDF); each checked to fail against a break (the page text's newline a blank, toggleTint not stepping, the no-outline check dropped, a PDF given no Recent place, a counted text-mode j taking half its count)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/behaviour/other_files.zig')
-rw-r--r--test/behaviour/other_files.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behaviour/other_files.zig b/test/behaviour/other_files.zig
index c0f9c08f..e778ad77 100644
--- a/test/behaviour/other_files.zig
+++ b/test/behaviour/other_files.zig
@@ -28,3 +28,13 @@ test "other-files: kbdin's Kalt rune is Alt on the key after it alone, and an Al
try s.keys("i\u{F015}zy\x1b");
try s.expect(s.at("/pane/{d}/body", .{try s.focused()}), "yx\n");
}
+
+test "other-files: /recent keeps a PDF as it keeps a file: open, then closed" {
+ var s = try Session.initFile(std.testing.allocator, "x\n");
+ defer s.deinit();
+ const n = try s.lookFile("docs/design.pdf");
+ const name = std.mem.trimEnd(u8, try s.read(s.at("/pane/{d}/name", .{n})), "\n");
+ try std.testing.expect(std.mem.indexOf(u8, try s.read("/recent"), s.at("open {s}\n", .{name})) != null);
+ try s.write(s.at("/pane/{d}/ctl", .{n}), "Del\n");
+ try std.testing.expect(std.mem.indexOf(u8, try s.read("/recent"), s.at("closed {s}\n", .{name})) != null);
+}