summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 13:55:25 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit7da8fe5005f0fd44899a1172e763fddcd7cac4d2 (patch)
tree32ebf8e16eaef888bdc560213673444a338fab78 /src/ninep
parent72937852d08a6a49f3c0cb2e903b533530b88ae1 (diff)
downloadpardes-7da8fe5005f0fd44899a1172e763fddcd7cac4d2.tar.gz
pardes-7da8fe5005f0fd44899a1172e763fddcd7cac4d2.zip
Addresses: acme's ; is tested and documented
/a/;/b/ searches b from the end of a (acme's addr.c:170-171 sets ar to the left side), and /a/,/b/ searches both from the current address; the review asked that it be confirmed, and it held. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/addr.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ninep/addr.zig b/src/ninep/addr.zig
index 3b29f622..0537c17a 100644
--- a/src/ninep/addr.zig
+++ b/src/ninep/addr.zig
@@ -272,6 +272,18 @@ test "an address is evaluated from the current one, as acme's are" {
}
// A range whose end comes before its start is sam's error.
try testing.expectEqualStrings(e_order, th.wr(p, addr, "#10,#5").reply.ename);
+
+ // `;` evaluates its right side from its left (acme's addr.c:170-171,
+ // `ar = r`), `,` from the address the whole started at.
+ const q = try th.withFile(testing.allocator, "b a b\n");
+ defer q.deinit();
+ const qaddr = Node.of(th.serialOf(q), .addr);
+ _ = th.wr(q, qaddr, "#0");
+ try testing.expectEqual(Status.ok, th.wr(q, qaddr, "/a/;/b/").reply.status);
+ try testing.expectEqual(@as(u32, 2), q.panes[0].?.fs.addr.q0);
+ try testing.expectEqual(@as(u32, 5), q.panes[0].?.fs.addr.q1);
+ _ = th.wr(q, qaddr, "#0");
+ try testing.expectEqualStrings(e_order, th.wr(q, qaddr, "/a/,/b/").reply.ename);
}
test "regular expressions search lines as sam's do, and a search wraps" {