diff options
Diffstat (limited to 'cmd/krino/render_test.go')
| -rw-r--r-- | cmd/krino/render_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/krino/render_test.go b/cmd/krino/render_test.go index a964b43..1b2f8cc 100644 --- a/cmd/krino/render_test.go +++ b/cmd/krino/render_test.go @@ -406,9 +406,15 @@ func TestColumnsCountWideAndCombiningCharacters(t *testing.T) { if n := cols("漢字"); n != 4 { t.Errorf("cols(漢字) = %d, want 4", n) } - if n := cols("éx"); n != 2 { + if n := cols("e\u0301x"); n != 2 { t.Errorf("cols(e + combining acute + x) = %d, want 2", n) } + // A format character is counted as one column: a terminal may draw it + // (a soft hyphen), and counting one too many only wraps a line early, + // while one too few lets it run past the edge (plan 11 review L4). + if n := cols("a\u00adb"); n != 3 { + t.Errorf("cols(a + soft hyphen + b) = %d, want 3", n) + } if got := padCell("漢字", 6); got != "漢字 " { t.Errorf("padCell(漢字, 6) = %q, want two spaces of padding", got) } |
