Skip to content

Commit a2b3e7d

Browse files
committed
patch 8.2.2656: some command line arguments and regexp errors not tested
Problem: Some command line arguments and regexp errors not tested. Solution: Add a few test cases. (Dominique Pellé, closes #8013)
1 parent 0a1a6a1 commit a2b3e7d

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

src/testdir/test_regexp_latin.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,17 @@ func Test_regexp_error()
924924
call assert_fails("call matchlist('x x', '\\%#=1 \\ze*')", 'E888:')
925925
call assert_fails("call matchlist('x x', '\\%#=2 \\zs*')", 'E888:')
926926
call assert_fails("call matchlist('x x', '\\%#=2 \\ze*')", 'E888:')
927-
call assert_fails('exe "normal /\\%#=1\\%[x\\%[x]]\<CR>"', 'E369:')
928927
call assert_fails("call matchstr('abcd', '\\%o841\\%o142')", 'E678:')
928+
call assert_fails("call matchstr('abcd', '\\%#=2\\%2147483647c')", 'E951:')
929+
call assert_fails("call matchstr('abcd', '\\%#=2\\%2147483647l')", 'E951:')
930+
call assert_fails("call matchstr('abcd', '\\%#=2\\%2147483647v')", 'E951:')
931+
call assert_fails('exe "normal /\\%#=1\\%[x\\%[x]]\<CR>"', 'E369:')
932+
call assert_fails('exe "normal /\\%#=2\\%2147483647l\<CR>"', 'E951:')
933+
call assert_fails('exe "normal /\\%#=2\\%2147483647c\<CR>"', 'E951:')
934+
call assert_fails('exe "normal /\\%#=2\\%102261126v\<CR>"', 'E951:')
935+
call assert_fails('exe "normal /\\%#=2\\%2147483646l\<CR>"', 'E486:')
936+
call assert_fails('exe "normal /\\%#=2\\%2147483646c\<CR>"', 'E486:')
937+
call assert_fails('exe "normal /\\%#=2\\%102261125v\<CR>"', 'E486:')
929938
call assert_equal('', matchstr('abcd', '\%o181\%o142'))
930939
endfunc
931940

src/testdir/test_startup.vim

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -860,10 +860,12 @@ func Test_t_arg()
860860
\ 'Xtags')
861861
call writefile([' first', ' second', ' third'], 'Xfile1')
862862

863-
if RunVim(before, after, '-t second')
864-
call assert_equal(['Xfile1:L2C5'], readfile('Xtestout'))
865-
call delete('Xtestout')
866-
endif
863+
for t_arg in ['-t second', '-tsecond']
864+
if RunVim(before, after, '-t second')
865+
call assert_equal(['Xfile1:L2C5'], readfile('Xtestout'), t_arg)
866+
call delete('Xtestout')
867+
endif
868+
endfor
867869

868870
call delete('Xtags')
869871
call delete('Xfile1')
@@ -1064,10 +1066,12 @@ func Test_w_arg()
10641066

10651067
" A number argument sets the 'window' option
10661068
call writefile(["iwindow \<C-R>=&window\<CR>\<Esc>:wq! Xresult\<CR>"], 'Xscriptin', 'b')
1067-
if RunVim([], [], '-s Xscriptin -w 17')
1068-
call assert_equal(["window 17"], readfile('Xresult'))
1069-
call delete('Xresult')
1070-
endif
1069+
for w_arg in ['-w 17', '-w17']
1070+
if RunVim([], [], '-s Xscriptin ' .. w_arg)
1071+
call assert_equal(["window 17"], readfile('Xresult'), w_arg)
1072+
call delete('Xresult')
1073+
endif
1074+
endfor
10711075
call delete('Xscriptin')
10721076
endfunc
10731077

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+
2656,
753755
/**/
754756
2655,
755757
/**/

0 commit comments

Comments
 (0)