From f75c4b39ece7b5f760892c1e18af449c5bb270c7 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 8 Feb 2018 15:11:56 +0100 Subject: shell: handle split-up UTF-8 sequences --- test/functional/ui/output_spec.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/functional/ui') diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua index 4e79c2e6cb..14f2091046 100644 --- a/test/functional/ui/output_spec.lua +++ b/test/functional/ui/output_spec.lua @@ -9,6 +9,7 @@ local feed_command = helpers.feed_command local iswin = helpers.iswin local clear = helpers.clear local command = helpers.command +local nvim_dir = helpers.nvim_dir describe("shell command :!", function() if helpers.pending_win32(pending) then return end @@ -195,5 +196,29 @@ describe("shell command :!", function() eq(true, screen.bell) end) end) + + it('handles multibyte sequences split over buffer boundaries', function() + command('cd '..nvim_dir) + local cmd + if iswin() then + cmd = '!shell-test UTF-8 ' + else + cmd = '!./shell-test UTF-8' + end + feed_command(cmd) + -- Note: only the first example of split composed char works + screen:expect([[ + {1:~ }| + {1:~ }| + :]]..cmd..[[ | + å | + ref: å̲ | + 1: å̲ | + 2: å ̲ | + 3: å ̲ | + | + {3:Press ENTER or type command to continue}^ | + ]]) + end) end) end) -- cgit