changeset 23984:e27b5529dc6a v8.2.2534

patch 8.2.2534: missing test coverage Commit: https://github.com/vim/vim/commit/a1070eae77f635f08b6f2612726b905796baaa58 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 20 19:21:36 2021 +0100 patch 8.2.2534: missing test coverage Problem: Missing test coverage. Solution: Improve test coverage for completion with different encodings, mapset(), and term function failures. (Dominique Pell?, closes #7877)
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 Feb 2021 19:30:03 +0100
parents 8911f8c83426
children 686f3c5377a3
files src/testdir/test_edit.vim src/testdir/test_maparg.vim src/testdir/test_terminal3.vim src/version.c
diffstat 4 files changed, 28 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -680,23 +680,26 @@ endfunc
 
 func Test_edit_CTRL_N()
   " Check keyword completion
-  new
-  set complete=.
-  call setline(1, ['INFER', 'loWER', '', '', ])
-  call cursor(3, 1)
-  call feedkeys("Ai\<c-n>\<cr>\<esc>", "tnix")
-  call feedkeys("ILO\<c-n>\<cr>\<esc>", '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\<c-n>\<cr>\<esc>", "tnix")
-  call feedkeys("ILO\<c-n>\<cr>\<esc>", 'tnix')
-  call assert_equal(['INFER', 'loWER', 'infer', 'LOWER', '', ''], getline(1, '$'))
+  for e in ['latin1', 'utf-8']
+    exe 'set encoding=' .. e
+    new
+    set complete=.
+    call setline(1, ['INFER', 'loWER', '', '', ])
+    call cursor(3, 1)
+    call feedkeys("Ai\<c-n>\<cr>\<esc>", "tnix")
+    call feedkeys("ILO\<c-n>\<cr>\<esc>", '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\<c-n>\<cr>\<esc>", "tnix")
+    call feedkeys("ILO\<c-n>\<cr>\<esc>", 'tnix')
+    call assert_equal(['INFER', 'loWER', 'infer', 'LOWER', '', ''], getline(1, '$'), e)
 
-  set noignorecase noinfercase complete&
-  bw!
+    set noignorecase noinfercase complete&
+    bw!
+  endfor
 endfunc
 
 func Test_edit_CTRL_O()
--- a/src/testdir/test_maparg.vim
+++ b/src/testdir/test_maparg.vim
@@ -240,6 +240,8 @@ func Test_mapset()
   bwipe!
 
   call assert_fails('call mapset([], v:false, {})', 'E730:')
+  call assert_fails('call mapset("i", 0, "")', 'E716:')
+  call assert_fails('call mapset("i", 0, {})', 'E460:')
 endfunc
 
 func Check_ctrlb_map(d, check_alt)
--- a/src/testdir/test_terminal3.vim
+++ b/src/testdir/test_terminal3.vim
@@ -301,6 +301,11 @@ func Test_term_func_invalid_arg()
     call assert_fails('let p = term_getansicolors([])', 'E745:')
     call assert_fails('call term_setansicolors([], [])', 'E745:')
   endif
+  let buf = term_start('echo')
+  call assert_fails('call term_setapi(' .. buf .. ', {})', 'E731:')
+  call assert_fails('call term_setkill(' .. buf .. ', {})', 'E731:')
+  call assert_fails('call term_setrestore(' .. buf .. ', {})', 'E731:')
+  exe buf . "bwipe!"
 endfunc
 
 " Test for sending various special keycodes to a terminal
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2534,
+/**/
     2533,
 /**/
     2532,