summaryrefslogtreecommitdiff
path: root/test/session.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-03 17:27:00 -0300
committerGabriel Schneider <[email protected]>2026-11-03 17:29:08 -0300
commite5b9badb0942f5269190dffdc745169a7aba0391 (patch)
tree8364ce4bfbbe7f35a23fa62eb03f3efc0b3b97fe /test/session.zig
parentd6694f29be417ccc568b2f7c20fe8d61b085fda3 (diff)
downloadpardes-e5b9badb0942f5269190dffdc745169a7aba0391.tar.gz
pardes-e5b9badb0942f5269190dffdc745169a7aba0391.zip
test: the pdf area's behavioural tests skip in a build without PDFs (-Dmupdf=false), as the old ones did: Session.lookFile of a .pdf skips the test when /commands has no PdfTint (seven failed there before, now eight skip); and a look at a page past the last of a PDF that is not open checks its miss in the log (other.pdf has no page 999), not /index alone; checked to fail against a break (Pdf.openPane's NoSuchPage answered with no miss), which passed the test before
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/session.zig')
-rw-r--r--test/session.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/session.zig b/test/session.zig
index f11a4c7f..4ac41d66 100644
--- a/test/session.zig
+++ b/test/session.zig
@@ -187,7 +187,10 @@ pub const Session = struct {
/// A Look of `path` at the root (one relative to the working directory
/// made absolute first); the serial of the pane with the keyboard after.
+ /// A PDF in a build without them (-Dmupdf=false: no PdfTint in
+ /// /commands) skips the test.
pub fn lookFile(s: *Session, path: []const u8) !u32 {
+ if (std.mem.endsWith(u8, path, ".pdf") and std.mem.indexOf(u8, try s.read("/commands"), "PdfTint") == null) return error.SkipZigTest;
var buf: [4096]u8 = undefined;
const abs = if (std.fs.path.isAbsolute(path)) path else s.at("{s}/{s}", .{ buf[0..try std.Io.Dir.cwd().realPath(std.testing.io, &buf)], path });
try s.write("/look", s.at("{s}\n", .{abs}));