diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour/addons.zig | 8 | ||||
| -rw-r--r-- | test/behaviour/addons_pdf.zig | 2 | ||||
| -rw-r--r-- | test/daemon.py | 4 | ||||
| -rw-r--r-- | test/liar.zig | 1 | ||||
| -rw-r--r-- | test/pdf-fixtures/huge-pages.pdf | 61 | ||||
| -rw-r--r-- | test/veil.zig | 1 |
6 files changed, 72 insertions, 5 deletions
diff --git a/test/behaviour/addons.zig b/test/behaviour/addons.zig index abadd781..8b54de02 100644 --- a/test/behaviour/addons.zig +++ b/test/behaviour/addons.zig @@ -37,7 +37,7 @@ test "addons: Addon load takes a library in, /addons lists it with the kinds com defer unload(&s, "fake"); // `<kind> <version> <abi> <panes open> <path> <blake3> <state>`. const listed = try s.read("/addons"); - try std.testing.expect(std.mem.startsWith(u8, listed, "fake 1 3.2 0 /")); + try std.testing.expect(std.mem.startsWith(u8, listed, "fake 1 3.3 0 /")); var fields = std.mem.tokenizeScalar(u8, listed[0..std.mem.indexOfScalar(u8, listed, '\n').?], ' '); for (0..5) |_| _ = fields.next(); try std.testing.expectEqual(@as(usize, 64), fields.next().?.len); @@ -51,7 +51,7 @@ test "addons: Addon load takes a library in, /addons lists it with the kinds com // A pane of it open, it stays; closed, it goes. try s.write("/ctl", "Fake\n"); const pane = try paneOf(&s, "fake"); - try std.testing.expect(std.mem.startsWith(u8, try s.read("/addons"), "fake 1 3.2 1 /")); + try std.testing.expect(std.mem.startsWith(u8, try s.read("/addons"), "fake 1 3.3 1 /")); try std.testing.expect(try s.refused("/ctl", "Addon unload fake\n") != 0); try std.testing.expect(has(s.said, "1 fake pane is open")); try s.write(s.at("/pane/{d}/ctl", .{pane}), "Del\n"); @@ -68,7 +68,7 @@ test "addons: a library of another ABI, one with no pardes_addon, and one whose try std.testing.expect(std.mem.startsWith(u8, listed, "fakeabi 1 2.2 0 /")); try std.testing.expect(has(listed, " refused: wants abi 2, this pardes speaks 3\n")); try std.testing.expect(has(listed, " refused: it has no pardes_addon\n")); - try std.testing.expect(has(listed, "\nfakeword 1 3.2 0 /")); + try std.testing.expect(has(listed, "\nfakeword 1 3.3 0 /")); try std.testing.expect(has(listed, " refused: word Save is the core's\n")); // A file that is no library at all: listed with what the loader said. var tmp = std.testing.tmpDir(.{}); @@ -120,7 +120,7 @@ test "addons: the image addon opens the pictures a Look names, fitted, with the defer s.deinit(); try load(&s, Session.image_addon); const listed = try s.read("/addons"); - try std.testing.expect(std.mem.startsWith(u8, listed, "image 1 3.2 0 /") and has(listed, " loaded\n")); + try std.testing.expect(std.mem.startsWith(u8, listed, "image 1 3.3 0 /") and has(listed, " loaded\n")); var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); var buf: [4096]u8 = undefined; diff --git a/test/behaviour/addons_pdf.zig b/test/behaviour/addons_pdf.zig index 18fa503c..0c7982d1 100644 --- a/test/behaviour/addons_pdf.zig +++ b/test/behaviour/addons_pdf.zig @@ -38,7 +38,7 @@ test "addons: a PDF is the pdf addon's pane, its pages pictures, its page in its s.graphics(); const n = try s.lookFile("docs/design.pdf"); try std.testing.expect(has(try s.read("/index"), " pdf ")); - try std.testing.expect(std.mem.startsWith(u8, try s.read("/addons"), "pdf 1 3.2 1 /")); + try std.testing.expect(std.mem.startsWith(u8, try s.read("/addons"), "pdf 1 3.3 1 /")); const pages = (try s.pdfPage(n))[1]; try std.testing.expectEqual(@as(u32, 16), pages); // Its first page, a picture over its body. diff --git a/test/daemon.py b/test/daemon.py index 90977ef4..c465b52f 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -3787,6 +3787,10 @@ def upgrades(old, new): raise TimeoutError(f'the client joined again: not {[c.stem for _, c in owners if c not in joined]} ' f'{time.monotonic() - t0:.1f} s after the Upgrade, the session back at {back:.1f} s') from None assert again.poll() is None and again5.poll() is None + # The session's news: each client's own screen says it (a long + # message shows its end), not only the view whose input came + # last before the Upgrade's step. + wait_for("each client's own screen saying the Upgrade's outcome", lambda: all(b'it goes on as' in t.text() for t, _ in owners), timeout=15) for (t, check), pane, theirs in zip(owners, mine, reversed(mine)): in_own_view('its own view again', lambda: made_live(t, check), client, pane, theirs) for c, t in ((again, term4), (again5, term5)): diff --git a/test/liar.zig b/test/liar.zig index f564614b..e7bc2763 100644 --- a/test/liar.zig +++ b/test/liar.zig @@ -32,6 +32,7 @@ pub const Liar = extern struct { }; pub const pardes_addon = addon.ops(Liar); +pub const panic = addon.panic; comptime { addon.exportLib(&pardes_addon); } diff --git a/test/pdf-fixtures/huge-pages.pdf b/test/pdf-fixtures/huge-pages.pdf new file mode 100644 index 00000000..f2d73a14 --- /dev/null +++ b/test/pdf-fixtures/huge-pages.pdf @@ -0,0 +1,61 @@ +%PDF-1.4 +1 0 obj +<< /Type /Catalog /Pages 2 0 R >> +endobj +2 0 obj +<< /Type /Pages /Kids [3 0 R 5 0 R 7 0 R 9 0 R] /Count 4 >> +endobj +3 0 obj +<< /Type /Page /Parent 2 0 R /MediaBox [0 0 1000000000 792] /Contents 4 0 R >> +endobj +4 0 obj +<< /Length 17 >> +stream +0 0 m 100 100 l S +endstream +endobj +5 0 obj +<< /Type /Page /Parent 2 0 R /MediaBox [0 0 1000000000000000000000000000000000000000000000 1000000000000000000000000000000000000000000000] /Contents 6 0 R >> +endobj +6 0 obj +<< /Length 17 >> +stream +0 0 m 100 100 l S +endstream +endobj +7 0 obj +<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /UserUnit 1000000000000000000000000000000000000 /Contents 8 0 R >> +endobj +8 0 obj +<< /Length 17 >> +stream +0 0 m 100 100 l S +endstream +endobj +9 0 obj +<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 10 0 R >> +endobj +10 0 obj +<< /Length 17 >> +stream +0 0 m 100 100 l S +endstream +endobj +xref +0 11 +0000000000 65535 f +0000000009 00000 n +0000000058 00000 n +0000000133 00000 n +0000000227 00000 n +0000000294 00000 n +0000000467 00000 n +0000000534 00000 n +0000000669 00000 n +0000000736 00000 n +0000000824 00000 n +trailer +<< /Size 11 /Root 1 0 R >> +startxref +892 +%%EOF diff --git a/test/veil.zig b/test/veil.zig index 0be5d218..ac51de1c 100644 --- a/test/veil.zig +++ b/test/veil.zig @@ -32,6 +32,7 @@ pub const Veil = extern struct { }; pub const pardes_addon = addon.ops(Veil); +pub const panic = addon.panic; comptime { addon.exportLib(&pardes_addon); } |
