test: add test for chinese character formatting bug#249
test: add test for chinese character formatting bug#249
Conversation
d6cd4ba to
6c6714f
Compare
|
Tests are failing, but the output isn't hugely helpful... It looks like the ansi code is different on the line where there is a difference, but it doesn't really help me narrow down the issue. The shorter text seems to format correctly which would be consistent with the original issue reported. === RUN TestWrapping
=== RUN TestWrapping/english_short
=== RUN TestWrapping/chinese_short
=== RUN TestWrapping/chinese_long
glamour_test.go:279: got != want
-want +got:
diff:
string{
... // 78204 identical bytes
0x6d, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x35, 0x32, 0x6d, 0x1b, 0x5b, 0x30, 0x6d, // |m.[38;5;252m.[0m|
0x20, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x35, 0x32, 0x6d, 0x31, 0x3a, 0x34, // | .[38;5;252m1:4|
+ 0x1b, 0x5b, 0x30, 0x6d, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x35, 0x32, 0x6d, // +|.[0m.[38;5;252m|
0x3a, 0x39, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x35, 0x32, 0x6d, 0x20, 0x1b, 0x5b, // |:9.[38;5;252m .[|
0x30, 0x6d, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x35, 0x32, 0x6d, 0x20, 0x1b, 0x5b, // |0m.[38;5;252m .[|
... // 340063 identical bytes
}
--- FAIL: TestWrapping (0.33s)
--- PASS: TestWrapping/english_short (0.00s)
--- PASS: TestWrapping/chinese_short (0.00s)
--- FAIL: TestWrapping/chinese_long (0.33s)
FAIL |
|
Soooo this is what (also thanks to the Go team for helping me figure out how to read the output: google/go-cmp#334) |
|
should test this against |
related charmbracelet/glow#499
I'm testing to reproduce the formatting issues in this bug report to confirm if Glamour is responsible for this behaviour. (wip)