diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 01:45:24 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | eeac8cdf456148f02546f69dc197c6e9dca7876d (patch) | |
| tree | aa3ffac5b2687e2d300c7e8944a45aaeab36c545 /src/ninep/ctl.zig | |
| parent | 8322d6507a854fc41bba42b9e8b8672d33cfe18b (diff) | |
| download | pardes-eeac8cdf456148f02546f69dc197c6e9dca7876d.tar.gz pardes-eeac8cdf456148f02546f69dc197c6e9dca7876d.zip | |
A look's miss repeats the path whole, up to 256 bytes
The miss message clipped what was looked at to 48 bytes, mid-word, and a
path past 160 bytes turned the has-no-line message into a bare no match.
Both now carry up to 256 bytes, cut on a character boundary with an
ellipsis past that.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index caa3f009..65878feb 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -997,6 +997,20 @@ test "the root look's file:/re/ goes on from the dot, and a miss leaves the dot try testing.expectEqualStrings(" 0 3 ", rd(p, dot, 0, 64).bytes); } +test "a look's miss repeats the path whole up to 256 bytes, then cuts it with an ellipsis" { + const gpa = testing.allocator; + const p = try withFile(gpa, "x\n"); + defer p.deinit(); + const root = @intFromEnum(tree.TopFile.look); + const long = "some/deeply/nested/directory/that/goes/on/and/on/with/a_rather_long_file_name.txt"; + var line: [512]u8 = undefined; + _ = wr(p, root, try std.fmt.bufPrint(&line, "{s}\n", .{long})); + try testing.expect(th.logHas(p, try std.fmt.bufPrint(&line, "look: no match for \"{s}\"\n", .{long}))); + const huge = "é" ** 150; // 300 bytes: cut at 256, between characters + _ = wr(p, root, huge ++ "\n"); + try testing.expect(th.logHas(p, "look: no match for \"" ++ "é" ** 128 ++ "…\"\n")); +} + test "exec runs a builtin at the pane and records the pane it acted on" { const gpa = testing.allocator; const p = try withFile(gpa, "Msg fs-ran\n"); |
