diff options
| -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" { |
