mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 08:56:29 +00:00
vim-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 vim/vim#8013)
a2b3e7dc92
Cherry-pick Test_t_arg() from patch v8.2.0509.
This commit is contained in:
@@ -814,6 +814,34 @@ func Test_v_argv()
|
|||||||
call assert_equal(['arg1', '--cmd', 'echo v:argv', '--cmd', 'q'']'], list[idx:])
|
call assert_equal(['arg1', '--cmd', 'echo v:argv', '--cmd', 'q'']'], list[idx:])
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for the '-t' option to jump to a tag
|
||||||
|
func Test_t_arg()
|
||||||
|
let before =<< trim [CODE]
|
||||||
|
set tags=Xtags
|
||||||
|
[CODE]
|
||||||
|
let after =<< trim [CODE]
|
||||||
|
let s = bufname('') .. ':L' .. line('.') .. 'C' .. col('.')
|
||||||
|
call writefile([s], "Xtestout")
|
||||||
|
qall
|
||||||
|
[CODE]
|
||||||
|
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
|
||||||
|
\ "first\tXfile1\t/^ \\zsfirst$/",
|
||||||
|
\ "second\tXfile1\t/^ \\zssecond$/",
|
||||||
|
\ "third\tXfile1\t/^ \\zsthird$/"],
|
||||||
|
\ 'Xtags')
|
||||||
|
call writefile([' first', ' second', ' third'], 'Xfile1')
|
||||||
|
|
||||||
|
for t_arg in ['-t second', '-tsecond']
|
||||||
|
if RunVim(before, after, '-t second')
|
||||||
|
call assert_equal(['Xfile1:L2C5'], readfile('Xtestout'), t_arg)
|
||||||
|
call delete('Xtestout')
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
call delete('Xtags')
|
||||||
|
call delete('Xfile1')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test the '-T' argument which sets the 'term' option.
|
" Test the '-T' argument which sets the 'term' option.
|
||||||
func Test_T_arg()
|
func Test_T_arg()
|
||||||
throw 'skipped: Nvim does not support "-T" argument'
|
throw 'skipped: Nvim does not support "-T" argument'
|
||||||
@@ -913,10 +941,12 @@ func Test_w_arg()
|
|||||||
|
|
||||||
" A number argument sets the 'window' option
|
" A number argument sets the 'window' option
|
||||||
call writefile(["iwindow \<C-R>=&window\<CR>\<Esc>:wq! Xresult\<CR>"], 'Xscriptin', 'b')
|
call writefile(["iwindow \<C-R>=&window\<CR>\<Esc>:wq! Xresult\<CR>"], 'Xscriptin', 'b')
|
||||||
if RunVim([], [], '-s Xscriptin -w 17')
|
for w_arg in ['-w 17', '-w17']
|
||||||
call assert_equal(["window 17"], readfile('Xresult'))
|
if RunVim([], [], '-s Xscriptin ' .. w_arg)
|
||||||
|
call assert_equal(["window 17"], readfile('Xresult'), w_arg)
|
||||||
call delete('Xresult')
|
call delete('Xresult')
|
||||||
endif
|
endif
|
||||||
|
endfor
|
||||||
call delete('Xscriptin')
|
call delete('Xscriptin')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user