summaryrefslogtreecommitdiff
path: root/test/behaviour/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-03 17:08:35 -0300
committerGabriel Schneider <[email protected]>2026-11-03 17:09:05 -0300
commit6ff5fc7447cc411dc24cb1d841130f15a410e354 (patch)
treeaf62dbe381cb6df4d19c0523b6d6cfd99e500773 /test/behaviour/panes.zig
parent5322d373c78ecee48b934886c95f3b8c4471a11f (diff)
downloadpardes-6ff5fc7447cc411dc24cb1d841130f15a410e354.tar.gz
pardes-6ff5fc7447cc411dc24cb1d841130f15a410e354.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/behaviour/panes.zig')
-rw-r--r--test/behaviour/panes.zig16
1 files changed, 16 insertions, 0 deletions
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);
+}