summaryrefslogtreecommitdiff
path: root/ui/buffers_test.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtzfr.eu>2020-06-13 12:39:35 +0200
committerHubert Hirtz <hubert@hirtzfr.eu>2020-06-13 12:39:35 +0200
commite213eebabff83f6d7d0d3d592f1dabcc23e81943 (patch)
tree832b208ac8b384593cc47e8b3020b34f9c848854 /ui/buffers_test.go
parentFix word wrapping for 1-wide characters (diff)
Add test for 0-width chars
Diffstat (limited to '')
-rw-r--r--ui/buffers_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/buffers_test.go b/ui/buffers_test.go
index e499203..80ac8ec 100644
--- a/ui/buffers_test.go
+++ b/ui/buffers_test.go
@@ -117,4 +117,22 @@ func TestRenderedHeight(t *testing.T) {
assertRenderedHeight(t, "have a good day!", 15, 2) // |have a good |day! |
assertRenderedHeight(t, "have a good day!", 16, 1) // |have a good day!|
assertRenderedHeight(t, "have a good day!", 17, 1) // |have a good day! |
+
+ // LEN=15, WIDTH=11
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 1, 10) // |b|a|r|m|a|n|d|:|c|c|
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 2, 5) // |ba|rm|an|d:|cc|
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 3, 4) // |bar|man|d: |cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 4, 3) // |barm|and:|cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 5, 3) // |barma|nd: |cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 6, 2) // |barman|d: cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 7, 2) // |barmand|: cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 8, 2) // |barmand:|cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 9, 2) // |barmand: |cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 10, 2) // |barmand: |cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 11, 1) // |barmand: cc|
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 12, 1) // |barmand: cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 13, 1) // |barmand: cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 14, 1) // |barmand: cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 15, 1) // |barmand: cc |
+ assertRenderedHeight(t, "\x0342barmand\x03: cc", 16, 1) // |barmand: cc |
}