diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 18:38:54 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | b608fc54c40ff3dff6057569bd65d3f729c6d4f9 (patch) | |
| tree | aadca13b7f78d6d7fdff1d5fba4700d877591b33 /src/File.zig | |
| parent | b6f07ba4e84e6d8474a118bee6e69e4b554417f1 (diff) | |
| download | pardes-b608fc54c40ff3dff6057569bd65d3f729c6d4f9.tar.gz pardes-b608fc54c40ff3dff6057569bd65d3f729c6d4f9.zip | |
The grapheme width test expects two cells for two invalid bytes, as qsltkuom draws them
Its reference list compared \xe4\xb8 with vaxis's own gwidth, which counts the pair one cell; since qsltkuom each invalid byte is a cell, one U+FFFD each, as surface.zig draws it, so the pair is two. The unit suite failed on it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/File.zig')
| -rw-r--r-- | src/File.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/File.zig b/src/File.zig index 99fccea8..9f0f329c 100644 --- a/src/File.zig +++ b/src/File.zig @@ -462,8 +462,11 @@ test "the ASCII arm of graphemeDisplayWidth matches the gwidth it skips" { } for ([_][]const u8{ "e\u{301}", "a\u{903}", "1\u{fe0f}\u{20e3}", "\u{4e16}", - "\u{1f642}", "\u{1f1e6}\u{1f1e7}", "\xff", "\xe4\xb8", + "\u{1f642}", "\u{1f1e6}\u{1f1e7}", "\xff", }) |g| try std.testing.expectEqual(ref(g), graphemeDisplayWidth(g)); + // Two invalid bytes are two cells, as surface.zig draws them, where + // vaxis's own count gives the pair one. + try std.testing.expectEqual(@as(usize, 2), graphemeDisplayWidth("\xe4\xb8")); } test "the ASCII run in fitEnd survives an exhaustive byte sweep" { |
