summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index aa309ad1..9a1a8da1 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2964,13 +2964,14 @@ test "every EINVAL a write gets says why, in its err record too; DEL is a contro
try testing.expect(th.logHas(p, "an empty name"));
}
-test "/index shows a name as the log does: a newline in it is \\n, controls spaces, bytes not UTF-8 \\xNN" {
+test "/index shows a name as the log does: a newline in it is \\n, a control byte, C1 or byte not UTF-8 \\xNN" {
const p = try th.withTerm(testing.allocator);
defer p.deinit();
const term = p.paneBySerial(serialOf(p)).?;
- p.setCwd(term, "/tmp/two\nlines\x7f\xff");
+ p.setCwd(term, "/tmp/two\nlines\x07\x7f\xc2\x85\xff");
const index = rd(p, @intFromEnum(tree.TopFile.index), 0, 4096).bytes;
- try testing.expect(std.mem.indexOf(u8, index, "/tmp/two\\nlines \\xff ") != null);
+ // Each byte as itself, so the name decodes to what it is.
+ try testing.expect(std.mem.indexOf(u8, index, "/tmp/two\\nlines\\x07\\x7f\\xc2\\x85\\xff ") != null);
try testing.expectEqual(@as(usize, 1), std.mem.count(u8, index, "\n"));
try testing.expect(index.len > 0);
try testing.expectEqual(@as(u64, 0), call(p, .{ .tag = 1, .op = .getattr, .node = @intFromEnum(tree.TopFile.index) }).reply.attr.size);