diff options
Diffstat (limited to 'test/behaviour/panes.zig')
| -rw-r--r-- | test/behaviour/panes.zig | 16 |
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); +} |
