From 6c9a91bebeaef7e863f4b37e8656f49e9aaf33ab Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 25 Aug 2022 07:59:17 +0800 Subject: vim-patch:8.2.2534: missing test coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Missing test coverage. Solution: Improve test coverage for completion with different encodings, mapset(), and term function failures. (Dominique Pellé, closes vim/vim#7877) https://github.com/vim/vim/commit/a1070eae77f635f08b6f2612726b905796baaa58 Cherry-pick E716 -> E715 change from patch 8.2.4861. --- src/nvim/testdir/test_edit.vim | 38 +++++++++++++++++++++----------------- src/nvim/testdir/test_maparg.vim | 2 ++ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index e26bbdc5be..fa288df0d9 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -713,23 +713,27 @@ endfunc func Test_edit_CTRL_N() " Check keyword completion - new - set complete=. - call setline(1, ['INFER', 'loWER', '', '', ]) - call cursor(3, 1) - call feedkeys("Ai\\\", "tnix") - call feedkeys("ILO\\\", 'tnix') - call assert_equal(['INFER', 'loWER', 'i', 'LO', '', ''], getline(1, '$')) - %d - call setline(1, ['INFER', 'loWER', '', '', ]) - call cursor(3, 1) - set ignorecase infercase - call feedkeys("Ii\\\", "tnix") - call feedkeys("ILO\\\", 'tnix') - call assert_equal(['INFER', 'loWER', 'infer', 'LOWER', '', ''], getline(1, '$')) - - set noignorecase noinfercase complete& - bw! + " for e in ['latin1', 'utf-8'] + for e in ['utf-8'] + exe 'set encoding=' .. e + new + set complete=. + call setline(1, ['INFER', 'loWER', '', '', ]) + call cursor(3, 1) + call feedkeys("Ai\\\", "tnix") + call feedkeys("ILO\\\", 'tnix') + call assert_equal(['INFER', 'loWER', 'i', 'LO', '', ''], getline(1, '$'), e) + %d + call setline(1, ['INFER', 'loWER', '', '', ]) + call cursor(3, 1) + set ignorecase infercase + call feedkeys("Ii\\\", "tnix") + call feedkeys("ILO\\\", 'tnix') + call assert_equal(['INFER', 'loWER', 'infer', 'LOWER', '', ''], getline(1, '$'), e) + + set noignorecase noinfercase complete& + bw! + endfor endfunc func Test_edit_CTRL_O() diff --git a/src/nvim/testdir/test_maparg.vim b/src/nvim/testdir/test_maparg.vim index dad4c81a7b..17c5f433ac 100644 --- a/src/nvim/testdir/test_maparg.vim +++ b/src/nvim/testdir/test_maparg.vim @@ -248,6 +248,8 @@ func Test_mapset() bwipe! call assert_fails('call mapset([], v:false, {})', 'E730:') + call assert_fails('call mapset("i", 0, "")', 'E715:') + call assert_fails('call mapset("i", 0, {})', 'E460:') endfunc func Check_ctrlb_map(d, check_alt) -- cgit