diff options
Diffstat (limited to 'ui/buffers_test.go')
-rw-r--r-- | ui/buffers_test.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/ui/buffers_test.go b/ui/buffers_test.go index b78f8e9..13a32de 100644 --- a/ui/buffers_test.go +++ b/ui/buffers_test.go @@ -6,7 +6,7 @@ import ( ) func assertSplitPoints(t *testing.T, body string, expected []point) { - l := Line{Body: body} + l := Line{Body: PlainString(body)} l.computeSplitPoints() if len(l.splitPoints) != len(expected) { @@ -71,7 +71,7 @@ func showSplit(s string, nls []int) string { } func assertNewLines(t *testing.T, body string, width int, expected int) { - l := Line{Body: body} + l := Line{Body: PlainString(body)} l.computeSplitPoints() actual := l.NewLines(width) @@ -141,6 +141,8 @@ func TestRenderedHeight(t *testing.T) { assertNewLines(t, "have a good day!", 17, 1) // |have a good day! | // LEN=15, WIDTH=11 + // TODO find other zero- or two-width chars, since IRC color codes are + // now handled by app.go assertNewLines(t, "\x0342barmand\x03: cc", 1, 10) // |b|a|r|m|a|n|d|:|c|c| assertNewLines(t, "\x0342barmand\x03: cc", 2, 5) // |ba|rm|an|d:|cc| assertNewLines(t, "\x0342barmand\x03: cc", 3, 4) // |bar|man|d: |cc | @@ -160,17 +162,3 @@ func TestRenderedHeight(t *testing.T) { assertNewLines(t, "cc en direct du word wrapping des familles le tests ça v a va va v a va", 46, 2) } - -/* -func assertTrimWidth(t *testing.T, s string, w int, expected string) { - actual := trimWidth(s, w) - if actual != expected { - t.Errorf("%q (width=%d): expected to be trimmed as %q, got %q\n", s, w, expected, actual) - } -} - -func TestTrimWidth(t *testing.T) { - assertTrimWidth(t, "ludovicchabant/fn", 16, "ludovicchabant/…") - assertTrimWidth(t, "zzzzzzzzzzzzzz黒猫/sr", 16, "zzzzzzzzzzzzzz黒…") -} -// */ |