Skip to content

Commit a1070ea

Browse files
committed
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)
1 parent 5b5ae29 commit a1070ea

4 files changed

Lines changed: 29 additions & 17 deletions

File tree

src/testdir/test_edit.vim

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -680,23 +680,26 @@ endfunc
680680

681681
func Test_edit_CTRL_N()
682682
" Check keyword completion
683-
new
684-
set complete=.
685-
call setline(1, ['INFER', 'loWER', '', '', ])
686-
call cursor(3, 1)
687-
call feedkeys("Ai\<c-n>\<cr>\<esc>", "tnix")
688-
call feedkeys("ILO\<c-n>\<cr>\<esc>", 'tnix')
689-
call assert_equal(['INFER', 'loWER', 'i', 'LO', '', ''], getline(1, '$'))
690-
%d
691-
call setline(1, ['INFER', 'loWER', '', '', ])
692-
call cursor(3, 1)
693-
set ignorecase infercase
694-
call feedkeys("Ii\<c-n>\<cr>\<esc>", "tnix")
695-
call feedkeys("ILO\<c-n>\<cr>\<esc>", 'tnix')
696-
call assert_equal(['INFER', 'loWER', 'infer', 'LOWER', '', ''], getline(1, '$'))
697-
698-
set noignorecase noinfercase complete&
699-
bw!
683+
for e in ['latin1', 'utf-8']
684+
exe 'set encoding=' .. e
685+
new
686+
set complete=.
687+
call setline(1, ['INFER', 'loWER', '', '', ])
688+
call cursor(3, 1)
689+
call feedkeys("Ai\<c-n>\<cr>\<esc>", "tnix")
690+
call feedkeys("ILO\<c-n>\<cr>\<esc>", 'tnix')
691+
call assert_equal(['INFER', 'loWER', 'i', 'LO', '', ''], getline(1, '$'), e)
692+
%d
693+
call setline(1, ['INFER', 'loWER', '', '', ])
694+
call cursor(3, 1)
695+
set ignorecase infercase
696+
call feedkeys("Ii\<c-n>\<cr>\<esc>", "tnix")
697+
call feedkeys("ILO\<c-n>\<cr>\<esc>", 'tnix')
698+
call assert_equal(['INFER', 'loWER', 'infer', 'LOWER', '', ''], getline(1, '$'), e)
699+
700+
set noignorecase noinfercase complete&
701+
bw!
702+
endfor
700703
endfunc
701704

702705
func Test_edit_CTRL_O()

src/testdir/test_maparg.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ func Test_mapset()
240240
bwipe!
241241

242242
call assert_fails('call mapset([], v:false, {})', 'E730:')
243+
call assert_fails('call mapset("i", 0, "")', 'E716:')
244+
call assert_fails('call mapset("i", 0, {})', 'E460:')
243245
endfunc
244246

245247
func Check_ctrlb_map(d, check_alt)

src/testdir/test_terminal3.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ func Test_term_func_invalid_arg()
301301
call assert_fails('let p = term_getansicolors([])', 'E745:')
302302
call assert_fails('call term_setansicolors([], [])', 'E745:')
303303
endif
304+
let buf = term_start('echo')
305+
call assert_fails('call term_setapi(' .. buf .. ', {})', 'E731:')
306+
call assert_fails('call term_setkill(' .. buf .. ', {})', 'E731:')
307+
call assert_fails('call term_setrestore(' .. buf .. ', {})', 'E731:')
308+
exe buf . "bwipe!"
304309
endfunc
305310

306311
" Test for sending various special keycodes to a terminal

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2534,
753755
/**/
754756
2533,
755757
/**/

0 commit comments

Comments
 (0)