diff options
author | erw7 <erw7.github@gmail.com> | 2019-06-08 12:55:19 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2019-06-09 13:29:51 +0900 |
commit | da8f7141cea0f532cb0858d506f750434d7968b8 (patch) | |
tree | 0b8a1abd818425994817403a0f13b25741bfbd82 /test/functional/ui/messages_spec.lua | |
parent | 1fbc01f4ab7c652b26f96fe19936f5f8e1f38e45 (diff) | |
download | rneovim-da8f7141cea0f532cb0858d506f750434d7968b8.tar.gz rneovim-da8f7141cea0f532cb0858d506f750434d7968b8.tar.bz2 rneovim-da8f7141cea0f532cb0858d506f750434d7968b8.zip |
Add msg_puts_printf() test for multibyte characters
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r-- | test/functional/ui/messages_spec.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index 7d21f40ce9..2f6e88a569 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -5,6 +5,10 @@ local eval = helpers.eval local eq = helpers.eq local command = helpers.command local set_method_error = helpers.set_method_error +local test_build_dir = helpers.test_build_dir +local nvim_prog = helpers.nvim_prog +local iswin = helpers.iswin +local exc_exec = helpers.exc_exec describe('ui/ext_messages', function() @@ -868,3 +872,43 @@ describe('ui/ext_messages', function() }} end) end) + +describe('ui/msg_puts_printf', function() + it('output multibyte characters correctly', function() + local screen + local cmd = '' + local locale_dir = test_build_dir..'/share/locale/ja/LC_MESSAGES' + + os.execute('cmake -E make_directory '..locale_dir) + os.execute('cmake -E copy '..test_build_dir..'/src/nvim/po/ja.mo '..locale_dir..'/nvim.mo') + clear({env={LANG='ja_JP.UTF-8'}}) + screen = Screen.new(25, 5) + screen:attach() + + if iswin() then + if os.execute('chcp 932 > NUL 2>&1') ~= 0 then + pending('missing japanese language features') + return + else + cmd = 'chcp 932 > NULL & ' + end + else + if exc_exec('lang ja_JP.UTF-8') ~= 0 then + pending('Locale ja_JP.UTF-8 not supported') + return + end + end + + cmd = cmd..'"'..nvim_prog..'" -u NONE -i NONE -Es -V1' + command([[call termopen(']]..cmd..[[')]]) + screen:expect([[ + ^Exモードに入ります. ノー | + マルモードに戻るには"visu| + al"と入力してください. | + : | + | + ]]) + + os.execute('cmake -E remove_directory '..test_build_dir..'/share') + end) +end) |