summaryrefslogtreecommitdiff
path: root/test/behaviour/tree.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 16:46:18 -0300
committerGabriel Schneider <[email protected]>2026-11-04 16:55:32 -0300
commit6bcb18e021a09d51539e628106a594748637ead2 (patch)
tree954996560c694dd7f0ab410aa01def00d25c33fe /test/behaviour/tree.zig
parentbe3985092df1c3388cfa09ca5e989d2fa66f55ec (diff)
downloadpardes-6bcb18e021a09d51539e628106a594748637ead2.tar.gz
pardes-6bcb18e021a09d51539e628106a594748637ead2.zip
test: fs.py's inline checks, quic_test, workflow_canary, python_repl_runs_one_line and signal_cleans_up moved to Zig, deleted from fs.py (its named cases stay): 21 process cases in test/process/ (flags: bad options refused in words, --9p naming the socket, forwarding a launch inside a session and the launches that start their own (mount, name, tcp, load, shells, toggle, quic), --wait and its refusals, pardes - and its +Pager (escapes, inks and Filter, progress, 11 MiB, the 256 MiB cut), $winid, the stdin boot, no terminal to draw on, a killed tty editor and its swept sockets, a signal unlinking the socket; mounts: --mount at startup, Mount and Unmount at run time, QUIC and TCP v4 and v6 detached and in a pty (skipped without -Dquic=true, passed with it); tree: the root and /os, 256-byte frames, a held ctl line, a frozen /screen, Look's precedence, 255-byte names; root-ctl: Restore detached and in a pty; builtins: Lspinfo; look-and-exec: the canary; repls: Python's pyrepl) and 3 behaviour tests (a 60 KB body write, truncated, a missing pane refused; a body write's EI record; keyword colour, not bold); process.zig gains, under fsb:, Conn.dialSized, dialTcp, replace, newPane, serials, look, pane, exec, execRefused, removePane, Files.fg, Detached.exists, abs, startTty, and Child (a program in a root's environment, its stdin fed, on a pty if asked, its stderr kept), run, code, entries, canonical, quicIncluded, nowMs, nap, has, check; each checked to fail against a break (no such option reworded, SyntaxBold on by default, a body insert's record not EI, Grep's miss reworded, already inside pardes reworded, a session already running reworded, Lspinfo's servers line reworded, no terminal to draw on reworded, unknown control message reworded); behaviour, process, fs-unit and core tests and the rest of fs.py pass
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/behaviour/tree.zig')
-rw-r--r--test/behaviour/tree.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/behaviour/tree.zig b/test/behaviour/tree.zig
index 7f9b37a4..56806589 100644
--- a/test/behaviour/tree.zig
+++ b/test/behaviour/tree.zig
@@ -42,3 +42,18 @@ test "tree: a terminal is listed as term with its directory as name, which a wri
try std.testing.expectEqual(@as(u16, 22), try s.refused(s.at("/pane/{d}/name", .{n}), "/elsewhere\n"));
try std.testing.expect(std.mem.startsWith(u8, s.said, "invalid rename: a terminal is named"));
}
+
+test "tree: a body takes a 60 KB write whole, a truncating one replaces it, and a pane not there is refused" {
+ var s = try Session.initFile(std.testing.allocator, "initial\n");
+ defer s.deinit();
+ var payload: std.ArrayList(u8) = .empty;
+ for (0..3000) |_| try payload.appendSlice(s.arena.allocator(), "const value = \"λ\";\n");
+ const n = try s.newPane();
+ const body = s.at("/pane/{d}/body", .{n});
+ try s.write(body, payload.items);
+ try s.expect(body, payload.items);
+ try s.replace(body, "replaced\n");
+ try s.expect(body, "replaced\n");
+ try std.testing.expectError(error.Refused, s.read("/pane/4294967295/body"));
+ try s.expect(body, "replaced\n");
+}