summaryrefslogtreecommitdiff
path: root/test/session.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-03 16:38:06 -0300
committerGabriel Schneider <[email protected]>2026-11-03 16:39:22 -0300
commita0320c49c1288e8e74f18983f18988a024952bb8 (patch)
tree5134488431aad3a2555198cc96ba9955e2cdad91 /test/session.zig
parentd197289c331365081295cb44f27ee2893294cffa (diff)
downloadpardes-a0320c49c1288e8e74f18983f18988a024952bb8.tar.gz
pardes-a0320c49c1288e8e74f18983f18988a024952bb8.zip
test: four more of src/ninep/ctl.zig's tests through the 9P tree alone (test/behaviour/look_and_exec, columns_and_tags, root_ctl): a look's leading blanks and exec's trim, a bare :N look from a pane's look, the root's and an event write-back (dot read from the dot file), a look after Newcol (the column read from /layout), size of a detached session (the screen read from /screen); Session's range and detach; each checked to fail against a break (a look's blanks trimmed, size taking a screen too small for its panes)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/session.zig')
-rw-r--r--test/session.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/session.zig b/test/session.zig
index 28557322..8b3c5c41 100644
--- a/test/session.zig
+++ b/test/session.zig
@@ -120,6 +120,17 @@ pub const Session = struct {
return out.items;
}
+ /// A range file (`dot`, `addr`, `limit`) as its two offsets.
+ pub fn range(s: *Session, path: []const u8) !struct { u32, u32 } {
+ var it = std.mem.tokenizeScalar(u8, try s.read(path), ' ');
+ return .{ try std.fmt.parseInt(u32, it.next() orelse return error.NoRange, 10), try std.fmt.parseInt(u32, it.next() orelse return error.NoRange, 10) };
+ }
+
+ /// No frontend attached, as a detached session's daemon says.
+ pub fn detach(s: *Session) void {
+ pardesOf(s).unattended = true;
+ }
+
/// The serial of the pane with the keyboard.
pub fn focused(s: *Session) !u32 {
return std.fmt.parseInt(u32, std.mem.trim(u8, try s.read("/focus"), "\n"), 10);