summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 16:31:13 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitff3738b2fe8312b0a108cf7301ec99e1c4d0a24b (patch)
tree1b58630c8d1b41ea451c45842e5c82b566ebba71 /src/ninep
parent8496759196e88e4fbd25ce19d3b04722c8f25f64 (diff)
downloadpardes-ff3738b2fe8312b0a108cf7301ec99e1c4d0a24b.tar.gz
pardes-ff3738b2fe8312b0a108cf7301ec99e1c4d0a24b.zip
Mini with no argument is wrong #args, EINVAL; Find, Grep and Mini say their names capitalised
Mini needs a file but did not say so, so a bare Mini ran and failed EIO. It now requires its argument, refused wrong #args (EINVAL) as every such word is. Its failures, Find's and Grep's start with the builtin's own name (Mini:, Find:, Grep:), as the others' do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 9d7557e6..7986333c 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1924,10 +1924,10 @@ test "Grep with no hit says grep: no match and opens nothing, a missing pane dir
for (p.panes) |slot| count += @intFromBool(slot != null);
const missed = wr(p, Node.of(serialOf(p), .exec), "Grep zzqqnomatchzz\n");
try testing.expectEqual(E.NOENT, missed.errno());
- try testing.expectEqualStrings("grep: pattern not found", missed.reply.ename);
+ try testing.expectEqualStrings("Grep: pattern not found", missed.reply.ename);
const unfound = wr(p, Node.of(serialOf(p), .exec), "Find zzqqnomatchzz\n");
try testing.expectEqual(E.NOENT, unfound.errno());
- try testing.expectEqualStrings("find: name not found", unfound.reply.ename);
+ try testing.expectEqualStrings("Find: name not found", unfound.reply.ename);
var after: usize = 0;
for (p.panes) |slot| after += @intFromBool(slot != null);
try testing.expectEqual(count, after);
@@ -2244,6 +2244,14 @@ test "a failure said while a 9P write waits on it posts no msg, only the write's
try testing.expect(p.fs.late_failure_len > 0);
}
+test "Mini with no argument is wrong #args, EINVAL, as every word that needs one" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ const r = wr(p, Node.of(serialOf(p), .ctl), "Mini\n");
+ try testing.expectEqual(E.INVAL, r.errno());
+ try testing.expectEqualStrings("wrong #args in control message \"Mini\"", r.reply.ename);
+}
+
test "every EINVAL a write gets says why, in its err record too; DEL is a control character in a line" {
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();