diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ninep/ctl.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index cf2068bc..c0695c76 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -2046,6 +2046,21 @@ test "a tag write refuses NUL and the other control characters" { } } +test "a malformed address is bad address syntax, on a terminal as on a text" { + const p = try th.withTerm(testing.allocator); + defer p.deinit(); + const t = try withFile(testing.allocator, "one\n"); + defer t.deinit(); + for ([_]*pardes.Pardes{ p, t }) |q| { + for ([_][]const u8{ "1x", "/(/", ",,x" }) |expr| { + const refused = wr(q, Node.of(serialOf(q), .addr), expr); + try testing.expectEqual(E.INVAL, refused.errno()); + try testing.expect(refused.reply.ename.len > 0); + } + try testing.expectEqualStrings("bad address syntax", wr(q, Node.of(serialOf(q), .addr), "1x").reply.ename); + } +} + test "size is monotonic: growing is never refused, and a size once taken is taken again" { const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 160, .rows = 60 }); defer p.deinit(); |
