]> granicus.if.org Git - vim/commitdiff
patch 8.2.2534: missing test coverage v8.2.2534
authorBram Moolenaar <Bram@vim.org>
Sat, 20 Feb 2021 18:21:36 +0000 (19:21 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 20 Feb 2021 18:21:36 +0000 (19:21 +0100)
Problem:    Missing test coverage.
Solution:   Improve test coverage for completion with different encodings,
            mapset(), and term function failures. (Dominique PellĂ©,
            closes #7877)

src/testdir/test_edit.vim
src/testdir/test_maparg.vim
src/testdir/test_terminal3.vim
src/version.c

index de3e3a161232e96b2992325efd762a06bf2f5793..6f083d95bd6934dacea6c543972b9e4ee8087c6d 100644 (file)
@@ -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, '$'))
-
-  set noignorecase noinfercase complete&
-  bw!
+  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!
+  endfor
 endfunc
 
 func Test_edit_CTRL_O()
index 285474d527059bc81f0705e9d6c3713e7bd25782..d0f2ec23f2a9ee273feca94f53e7d06ded504f9e 100644 (file)
@@ -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)
index eaf37e6745ec7681e58316e15e8b62dc0cd19488..037d935582c928e049c0c21255371687c05a18ca 100644 (file)
@@ -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
index f83f03879e19ada5d0ad59195e9059e5d5c7c4fe..9363c3f5e61bb2ec9e47de78ddd99ce8e473cbc2 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2534,
 /**/
     2533,
 /**/