Mercurial > vim
comparison src/testdir/test_terminal.vim @ 13557:4911058c43eb v8.0.1652
patch 8.0.1652: term_dumpwrite() does not output composing characters
commit https://github.com/vim/vim/commit/f06b0b6c8f85ea9c320f2be30b25ed084969c1e2
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 29 17:22:24 2018 +0200
patch 8.0.1652: term_dumpwrite() does not output composing characters
Problem: term_dumpwrite() does not output composing characters.
Solution: Use the cell index.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 29 Mar 2018 17:30:06 +0200 |
parents | 78ead137b2ad |
children | af68603e213d |
comparison
equal
deleted
inserted
replaced
13556:b1810bf15dfc | 13557:4911058c43eb |
---|---|
976 call assert_equal('one two three four five', trim(getline(a:off + 1))) | 976 call assert_equal('one two three four five', trim(getline(a:off + 1))) |
977 call assert_equal('~ Select Word', trim(getline(a:off + 7))) | 977 call assert_equal('~ Select Word', trim(getline(a:off + 7))) |
978 call assert_equal(':popup PopUp :', trim(getline(a:off + 20))) | 978 call assert_equal(':popup PopUp :', trim(getline(a:off + 20))) |
979 endfunc | 979 endfunc |
980 | 980 |
981 func Test_terminal_dumpwrite_composing() | |
982 if !CanRunVimInTerminal() | |
983 return | |
984 endif | |
985 let save_enc = &encoding | |
986 set encoding=utf-8 | |
987 call assert_equal(1, winnr('$')) | |
988 | |
989 let text = " a\u0300 e\u0302 o\u0308" | |
990 call writefile([text], 'Xcomposing') | |
991 let buf = RunVimInTerminal('Xcomposing', {}) | |
992 call WaitFor({-> term_getline(buf, 1) =~ text}) | |
993 call term_dumpwrite(buf, 'Xdump') | |
994 let dumpline = readfile('Xdump')[0] | |
995 call assert_match('|à| |ê| |ö', dumpline) | |
996 | |
997 call StopVimInTerminal(buf) | |
998 call delete('Xcomposing') | |
999 call delete('Xdump') | |
1000 let &encoding = save_enc | |
1001 endfunc | |
1002 | |
981 " just testing basic functionality. | 1003 " just testing basic functionality. |
982 func Test_terminal_dumpload() | 1004 func Test_terminal_dumpload() |
983 call assert_equal(1, winnr('$')) | 1005 call assert_equal(1, winnr('$')) |
984 call term_dumpload('dumps/Test_popup_command_01.dump') | 1006 call term_dumpload('dumps/Test_popup_command_01.dump') |
985 call assert_equal(2, winnr('$')) | 1007 call assert_equal(2, winnr('$')) |