aboutsummaryrefslogtreecommitdiff
path: root/cmd/krino/render_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 00:29:09 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 00:29:09 +0200
commit17e933a16ff7de1b06d62504e78c40e615c8b553 (patch)
tree0ceb58ff18f9ee6f35fbcb6255c8a830e6124b84 /cmd/krino/render_test.go
parent59015f1f91d640502fdfc34019cf0154b5206bb8 (diff)
downloadkrino-17e933a16ff7de1b06d62504e78c40e615c8b553.tar.gz
krino-17e933a16ff7de1b06d62504e78c40e615c8b553.zip
review and undo headings wrap past the label column; format characters take a column
Diffstat (limited to 'cmd/krino/render_test.go')
-rw-r--r--cmd/krino/render_test.go8
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)
}