diff options
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 2a2131e3..c3658df4 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -2264,6 +2264,10 @@ test "a PDF's body reads its page's text layer, and takes no write" { try testing.expect(doc.hasPdf()); const body = Node.of(doc.serial, .body); try testing.expect(std.mem.indexOf(u8, rd(p, body, 0, 4096).bytes, "target.txt") != null); + // Read from an offset, as a mount's chunked reads ask: the text from there. + const whole = try testing.allocator.dupe(u8, rd(p, body, 0, 4096).bytes); + defer testing.allocator.free(whole); + try testing.expectEqualStrings(whole[3..], rd(p, body, 3, 4096).bytes); try testing.expectEqual(E.INVAL, wr(p, body, "more\n").errno()); } |
