mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #14540 from Shougo/fix_vim8.1.1378
[RFC] Improve tests
This commit is contained in:
commit
120a881630
@ -1,5 +1,9 @@
|
|||||||
" Test argument list commands
|
" Test argument list commands
|
||||||
|
|
||||||
|
func Reset_arglist()
|
||||||
|
args a | %argd
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_argidx()
|
func Test_argidx()
|
||||||
args a b c
|
args a b c
|
||||||
last
|
last
|
||||||
@ -26,6 +30,8 @@ func Test_argidx()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_argadd()
|
func Test_argadd()
|
||||||
|
call Reset_arglist()
|
||||||
|
|
||||||
%argdelete
|
%argdelete
|
||||||
argadd a b c
|
argadd a b c
|
||||||
call assert_equal(0, argidx())
|
call assert_equal(0, argidx())
|
||||||
@ -115,8 +121,7 @@ endfunc
|
|||||||
" Test for [count]argument and [count]argdelete commands
|
" Test for [count]argument and [count]argdelete commands
|
||||||
" Ported from the test_argument_count.in test script
|
" Ported from the test_argument_count.in test script
|
||||||
func Test_argument()
|
func Test_argument()
|
||||||
" Clean the argument list
|
call Reset_arglist()
|
||||||
arga a | %argd
|
|
||||||
|
|
||||||
let save_hidden = &hidden
|
let save_hidden = &hidden
|
||||||
set hidden
|
set hidden
|
||||||
@ -244,8 +249,7 @@ endfunc
|
|||||||
" Test for 0argadd and 0argedit
|
" Test for 0argadd and 0argedit
|
||||||
" Ported from the test_argument_0count.in test script
|
" Ported from the test_argument_0count.in test script
|
||||||
func Test_zero_argadd()
|
func Test_zero_argadd()
|
||||||
" Clean the argument list
|
call Reset_arglist()
|
||||||
arga a | %argd
|
|
||||||
|
|
||||||
arga a b c d
|
arga a b c d
|
||||||
2argu
|
2argu
|
||||||
@ -272,10 +276,6 @@ func Test_zero_argadd()
|
|||||||
call assert_equal('file with spaces', expand('%'))
|
call assert_equal('file with spaces', expand('%'))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Reset_arglist()
|
|
||||||
args a | %argd
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Test for argc()
|
" Test for argc()
|
||||||
func Test_argc()
|
func Test_argc()
|
||||||
call Reset_arglist()
|
call Reset_arglist()
|
||||||
|
@ -1592,6 +1592,10 @@ func Test_bufadd_bufload()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_readdir()
|
func Test_readdir()
|
||||||
|
if isdirectory('Xdir')
|
||||||
|
call delete('Xdir', 'rf')
|
||||||
|
endif
|
||||||
|
|
||||||
call mkdir('Xdir')
|
call mkdir('Xdir')
|
||||||
call writefile([], 'Xdir/foo.txt')
|
call writefile([], 'Xdir/foo.txt')
|
||||||
call writefile([], 'Xdir/bar.txt')
|
call writefile([], 'Xdir/bar.txt')
|
||||||
|
@ -3653,6 +3653,9 @@ func Xqftick_tests(cchar)
|
|||||||
\ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'r')
|
\ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'r')
|
||||||
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
|
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
|
||||||
|
if isdirectory("Xone")
|
||||||
|
call delete("Xone", 'rf')
|
||||||
|
endif
|
||||||
call writefile(["F8:80:L80", "F8:81:L81"], "Xone")
|
call writefile(["F8:80:L80", "F8:81:L81"], "Xone")
|
||||||
Xfile Xone
|
Xfile Xone
|
||||||
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
@ -43,6 +43,10 @@ func Test_yank_shows_register()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_display_registers()
|
func Test_display_registers()
|
||||||
|
" Disable clipboard
|
||||||
|
let save_clipboard = get(g:, 'clipboard', {})
|
||||||
|
let g:clipboard = {}
|
||||||
|
|
||||||
e file1
|
e file1
|
||||||
e file2
|
e file2
|
||||||
call setline(1, ['foo', 'bar'])
|
call setline(1, ['foo', 'bar'])
|
||||||
@ -78,6 +82,7 @@ func Test_display_registers()
|
|||||||
\ . ' c ": ls', a)
|
\ . ' c ": ls', a)
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
|
let g:clipboard = save_clipboard
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_recording_status_in_ex_line()
|
func Test_recording_status_in_ex_line()
|
||||||
|
@ -20,6 +20,9 @@ describe('packadd', function()
|
|||||||
|
|
||||||
func SetUp()
|
func SetUp()
|
||||||
let s:topdir = expand(getcwd() . '/Xdir')
|
let s:topdir = expand(getcwd() . '/Xdir')
|
||||||
|
if isdirectory(s:topdir)
|
||||||
|
call delete(s:topdir, 'rf')
|
||||||
|
endif
|
||||||
exe 'set packpath=' . s:topdir
|
exe 'set packpath=' . s:topdir
|
||||||
let s:plugdir = expand(s:topdir . '/pack/mine/opt/mytest')
|
let s:plugdir = expand(s:topdir . '/pack/mine/opt/mytest')
|
||||||
endfunc
|
endfunc
|
||||||
|
Loading…
Reference in New Issue
Block a user