diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 19:46:24 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | d5c6563c95b942f1d2dade817e11ae38fc99e880 (patch) | |
| tree | ce61f37dce9cb1f7450551ea9f9148842d09dd01 /src/ninep | |
| parent | 9ba51f2fb70a47dc218a864f8fd188f2585fd6fe (diff) | |
| download | pardes-d5c6563c95b942f1d2dade817e11ae38fc99e880.tar.gz pardes-d5c6563c95b942f1d2dade817e11ae38fc99e880.zip | |
A look's miss cuts a long path in its middle with the Rerror cutter, keeping the file's name, never mid-word at 64 bytes
"is no text to address" cut the path at 64 bytes, often mid-word and
losing the file's name, and the other misses cut theirs at 256 from
the end, losing it too. Every miss now goes through fitErr, the cutter
an Rerror uses, which gives up the middle of the longest path so the
start and the name at the end both stay.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
| -rw-r--r-- | src/ninep/ctl.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 4fab699a..27361124 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -1449,7 +1449,7 @@ 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" { +test "a look's miss repeats the path whole up to 256 bytes, then gives up its middle to an ellipsis" { const gpa = testing.allocator; const p = try withFile(gpa, "x\n"); defer p.deinit(); @@ -1458,9 +1458,9 @@ test "a look's miss repeats the path whole up to 256 bytes, then cuts it with an 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 + const huge = "é" ** 150; // 300 bytes: its middle cut to fit 256, between characters _ = wr(p, root, huge ++ "\n"); - try testing.expect(th.logHas(p, "look: no match for \"" ++ "é" ** 128 ++ "…\"\n")); + try testing.expect(th.logHas(p, "look: no match for \"" ++ "é" ** 63 ++ "…" ++ "é" ** 63 ++ "\"\n")); } test "exec runs a builtin at the pane and records the pane it acted on" { |
