commit e213eeb

Hubert Hirtz  ·  2020-06-13 10:39:35 +0000 UTC
parent 79f3059
Add test for 0-width chars
1 files changed,  +18, -0
+18, -0
 1@@ -117,4 +117,22 @@ func TestRenderedHeight(t *testing.T) {
 2 	assertRenderedHeight(t, "have a good day!", 15, 2) // |have a good    |day!           |
 3 	assertRenderedHeight(t, "have a good day!", 16, 1) // |have a good day!|
 4 	assertRenderedHeight(t, "have a good day!", 17, 1) // |have a good day! |
 5+
 6+	// LEN=15, WIDTH=11
 7+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 1, 10) // |b|a|r|m|a|n|d|:|c|c|
 8+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 2, 5)  // |ba|rm|an|d:|cc|
 9+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 3, 4)  // |bar|man|d: |cc |
10+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 4, 3)  // |barm|and:|cc  |
11+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 5, 3)  // |barma|nd:  |cc   |
12+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 6, 2)  // |barman|d: cc |
13+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 7, 2)  // |barmand|: cc   |
14+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 8, 2)  // |barmand:|cc      |
15+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 9, 2)  // |barmand: |cc       |
16+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 10, 2) // |barmand:  |cc        |
17+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 11, 1) // |barmand: cc|
18+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 12, 1) // |barmand: cc |
19+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 13, 1) // |barmand: cc  |
20+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 14, 1) // |barmand: cc   |
21+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 15, 1) // |barmand: cc    |
22+	assertRenderedHeight(t, "\x0342barmand\x03: cc", 16, 1) // |barmand: cc     |
23 }