From 17e933a16ff7de1b06d62504e78c40e615c8b553 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 15 Sep 2026 00:29:09 +0200 Subject: review and undo headings wrap past the label column; format characters take a column --- cmd/krino/render_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd/krino/render_test.go') 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) } -- cgit v1.3