diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour/look_and_exec.zig | 1 | ||||
| -rw-r--r-- | test/session.zig | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/test/behaviour/look_and_exec.zig b/test/behaviour/look_and_exec.zig index a6f28960..83ade2fc 100644 --- a/test/behaviour/look_and_exec.zig +++ b/test/behaviour/look_and_exec.zig @@ -106,6 +106,7 @@ test "look-and-exec: a look at a PDF's page past its last is a miss, never the l const index = try s.read("/index"); _ = try s.refused(look, s.at("{s}/other.pdf:999\n", .{dir})); try s.expect("/index", index); + try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), "other.pdf has no page 999") != null); } test "look-and-exec: a +PdfSections row's first number is the page: a section not there, or on another page, is a miss said" { 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})); |
