From ccb668645e9afc3710b1a50903022367a800ff1b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 3 Nov 2026 17:28:55 -0300 Subject: test: four more of src/pardes.zig's tests through the 9P tree alone (test/behaviour/limits, settings, placement): a builtin that needs a pane refused in words once every one of the 64 slots is taken, Pet refused in a terminal's view from a pane and the root (a window's pets read back from /ctl), New and 9P's new taking the bottom half of a column's last pane, Placement pardes putting a pane right under the asking one and stepping back to acme bare (each read from /ctl); each checked to fail against a break (openHelp's failure unsaid, a GUI-only word run in a terminal's view, acmePlace's split at a quarter, pardes placement placing as acme) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/behaviour/limits.zig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/behaviour/limits.zig (limited to 'test/behaviour/limits.zig') diff --git a/test/behaviour/limits.zig b/test/behaviour/limits.zig new file mode 100644 index 00000000..08c864eb --- /dev/null +++ b/test/behaviour/limits.zig @@ -0,0 +1,18 @@ +//! docs/typ/reference.typ, Limits . +const std = @import("std"); +const Session = @import("session").Session; + +test "limits: a builtin that needs a pane says so when every slot is taken" { + var s = try Session.initFile(std.testing.allocator, "x\n"); + defer s.deinit(); + const n = try s.focused(); + // Room on the screen for every pane, so the slots run out first. + s.detach(); + try s.write("/ctl", "size 100 400\n"); + var made: usize = 1; + while (s.newPane()) |_| made += 1 else |_| {} + try std.testing.expectEqual(@as(usize, 64), made); + _ = try s.refused(s.at("/pane/{d}/exec", .{n}), "Help\n"); + try std.testing.expectEqualStrings("help: no space for a pane: 64 max", s.said); + try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), "help: no space for a pane") != null); +} -- cgit v1.3