From 6ff5fc7447cc411dc24cb1d841130f15a410e354 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 3 Nov 2026 17:08:35 -0300 Subject: test: three of test/output.zig's tests through the 9P tree alone: DumpConfig's report in its one +DumpConfig pane, a second refreshing it in place (settings, a new file: /index, /focus and its body, Theme acme seen there), Config with no configuration directory refused, said in the log and opening nothing (settings), a Mini that cannot read its file leaving the panes, the last snapshot and the keyboard as they were (panes); the startup path line stays, a process flag with no 9P surface; each checked to fail against a break (openRead never reusing an output pane, Config taking a made-up path when there is no directory, a failed Mini giving the keyboard back to its caller) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/behaviour/panes.zig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/behaviour/panes.zig') diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig index 8a906c2b..90c283b7 100644 --- a/test/behaviour/panes.zig +++ b/test/behaviour/panes.zig @@ -118,3 +118,19 @@ test "panes: PdfSections on a PDF with no outline says so and opens nothing" { } try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), "PdfSections: this PDF has no outline") != null); } + +test "panes: a Mini that cannot read its file leaves the panes, the last Mini's snapshot and the keyboard as they were" { + var s = try Session.initFile(std.testing.allocator, "abc\n"); + defer s.deinit(); + const text = try s.focused(); + const exec = s.at("/pane/{d}/exec", .{text}); + try s.write(exec, s.at("Mini /virtual/pane/{d}/body\n", .{text})); + const mini = try s.focused(); + try std.testing.expect(mini != text); + const body = try s.read(s.at("/pane/{d}/body", .{mini})); + const index = try s.read("/index"); + try std.testing.expectEqual(@as(u16, 2), try s.refused(exec, "Mini /virtual/does-not-exist\n")); + try std.testing.expectEqual(mini, try s.focused()); + try s.expect("/index", index); + try s.expect(s.at("/pane/{d}/body", .{mini}), body); +} -- cgit v1.3