diff options
Diffstat (limited to 'test/functional/ui/multibyte_spec.lua')
-rw-r--r-- | test/functional/ui/multibyte_spec.lua | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/test/functional/ui/multibyte_spec.lua b/test/functional/ui/multibyte_spec.lua index 3e63353ad2..e6a79feadc 100644 --- a/test/functional/ui/multibyte_spec.lua +++ b/test/functional/ui/multibyte_spec.lua @@ -21,10 +21,6 @@ describe("multibyte rendering", function() }) end) - after_each(function() - screen:detach() - end) - it("works with composed char at start of line", function() insert([[ ̊ @@ -127,20 +123,20 @@ describe('multibyte rendering: statusline', function() before_each(function() clear() screen = Screen.new(40, 4) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue1}, + [2] = {bold = true, reverse = true}, + }) screen:attach() command('set laststatus=2') end) - after_each(function() - screen:detach() - end) - it('last char shows (multibyte)', function() command('set statusline=你好') screen:expect([[ ^ | - ~ | - 你好 | + {1:~ }| + {2:你好 }| | ]]) end) @@ -148,8 +144,8 @@ describe('multibyte rendering: statusline', function() command('set statusline=abc') screen:expect([[ ^ | - ~ | - abc | + {1:~ }| + {2:abc }| | ]]) end) @@ -157,8 +153,8 @@ describe('multibyte rendering: statusline', function() command('set statusline=') screen:expect([[ ^ | - ~ | - <9f> | + {1:~ }| + {2:<9f> }| | ]]) end) @@ -167,8 +163,8 @@ describe('multibyte rendering: statusline', function() -- o + U+1DF0 + U+20EF + U+0338 + U+20D0 + U+20E7 + U+20DD screen:expect([[ ^ | - ~ | - o̸⃯ᷰ⃐⃧⃝ | + {1:~ }| + {2:o̸⃯ᷰ⃐⃧⃝ }| | ]]) end) @@ -177,9 +173,19 @@ describe('multibyte rendering: statusline', function() -- U+9F + U+1DF0 + U+20EF + U+0338 + U+20D0 + U+20E7 + U+20DD screen:expect([[ ^ | - ~ | - <9f><1df0><20ef><0338><20d0><20e7><20dd>| + {1:~ }| + {2:<9f><1df0><20ef><0338><20d0><20e7><20dd>}| | ]]) end) + + it('hidden group %( %) does not cause invalid unicode', function() + command("let &statusline = '%#StatColorHi2#%(✓%#StatColorHi2#%) Q≡'") + screen:expect{grid=[[ + ^ | + {1:~ }| + {2: Q≡ }| + | + ]]} + end) end) |