summaryrefslogtreecommitdiff
path: root/test/behaviour/placement.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 10:52:24 -0300
committerGabriel Schneider <[email protected]>2026-11-04 10:56:17 -0300
commit350e7cc22b85130cbe95a114c668945b1dc12fd7 (patch)
tree26454697f244051bb3b616cb7810e3dcade54eeb /test/behaviour/placement.zig
parentb798f2c1cf5dd4f98c8c1f81c8642b005890f6ee (diff)
downloadpardes-350e7cc22b85130cbe95a114c668945b1dc12fd7.tar.gz
pardes-350e7cc22b85130cbe95a114c668945b1dc12fd7.zip
test: twenty-two more of src/ninep/ctl.zig's tests through the 9P tree alone: in test/behaviour/look_and_exec.zig a look opening a spaced path at its line and column leaving the source as it was, a batch validated whole before any virtual file opens, /status's lines, mode and refusal with look and exec validating batches and reading back their panes, a look at a file it may not read, a trailing colon dropped and a failed address opening nothing, a file:/re/ miss logged as its file's pane, a look into another pane leaving the source's dot, a word looked for in its own pane (wrapping, then LookWord list's +Search), a second LookWord list look refilling its +Search, @pN: and a line past the end said one way, an exec over the command limit, a builtin failing through exec, tagexec and a column's exec with one err and no msg, and Look . from a gone directory; in rules.zig every EINVAL's words, the log's too; in limits.zig a ctl line over 1 MiB refused once; in panes.zig acme's ctl words and +Unsaved dropping a closed pane's row; in the new from_acme.zig Put, Delete and acme's words refused; in settings.zig GUI-only settings and DumpDir read back; in root_ctl.zig Joincol and Theme's refusals and a theme's name in any case; in placement.zig a look from a pane made after Delcol placed in a column; in edit.zig Edit ,p logged with no room for +Errors; the status test kept for its window's pointer line, and Joincol's for themesNear's unit checks, each trimmed; each checked to fail against a break (status's pane count, a look's open failure words, the trailing colon kept, e_no_match, the empty name's words, the 1 MiB cap doubled, acme's Put renamed, the GUI-only words, themeIndex by case, command_max 1023, a repeat counted by two, Look .'s no such directory words, dropUnsaved doing nothing, lookWord not wrapping, limit=addr not taking, Edit's text not logged when unplaced, @pN: with no address a miss, a look into another pane clearing the source's dot, a column taken as the cursor's, the batch's control-character check and command's checking pass both skipped, LookWord's +Search never shared, atFoot placing nothing)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/behaviour/placement.zig')
-rw-r--r--test/behaviour/placement.zig20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig
index 079b5a5e..893cd9a4 100644
--- a/test/behaviour/placement.zig
+++ b/test/behaviour/placement.zig
@@ -59,3 +59,23 @@ test "placement: Placement pardes puts a new pane right under the asking one, an
try s.write("/ctl", "Placement\n");
try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPlacement acme\n") != null);
}
+
+test "placement: a look under pardes's placement, from a pane pane/new made after Delcol, opens its file in a column" {
+ var tmp = std.testing.tmpDir(.{});
+ defer tmp.cleanup();
+ try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "f.txt", .data = "file\n" });
+ var buf: [4096]u8 = undefined;
+ const dir = buf[0..try tmp.dir.realPath(std.testing.io, &buf)];
+ var s = try Session.initFile(std.testing.allocator, "x\n");
+ defer s.deinit();
+ const first = try s.focused();
+ try s.write(s.at("/pane/{d}/exec", .{first}), "Placement\n");
+ try s.write(s.at("/pane/{d}/exec", .{first}), "Delcol\n");
+ const made = try s.newPane();
+ try s.write(s.at("/pane/{d}/look", .{made}), s.at("{s}/f.txt:#4\n", .{dir}));
+ const opened = try s.focused();
+ try std.testing.expect(opened != made);
+ // The pane pane/new made is placed, and so is the one its look opened.
+ const cols = try s.columns();
+ for ([_]u32{ made, opened }) |n| try std.testing.expect(std.mem.indexOf(u8, cols, s.at(":{d}", .{n})) != null or std.mem.indexOf(u8, cols, s.at(",{d}", .{n})) != null);
+}