mirror of
https://github.com/neovim/neovim.git
synced 2026-04-23 07:45:32 +00:00
vim-patch:9.1.2071: tests: test_ins_complete.vim leaves swapfiles behind
Problem: tests: test_ins_complete.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!
closes: vim/vim#19137
0e0cb8520c
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -1127,13 +1127,13 @@ func Test_completefunc_error()
|
|||||||
%d
|
%d
|
||||||
set complete=F
|
set complete=F
|
||||||
call assert_fails('exe "normal a\<C-N>"', 'E565:')
|
call assert_fails('exe "normal a\<C-N>"', 'E565:')
|
||||||
close!
|
bw!
|
||||||
|
|
||||||
set completefunc& complete&
|
set completefunc& complete&
|
||||||
delfunc CompleteFunc
|
delfunc CompleteFunc
|
||||||
delfunc CompleteFunc2
|
delfunc CompleteFunc2
|
||||||
delfunc CompleteFunc3
|
delfunc CompleteFunc3
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for returning non-string values from 'completefunc'
|
" Test for returning non-string values from 'completefunc'
|
||||||
@@ -1332,7 +1332,7 @@ func Test_complete_wrapscan()
|
|||||||
setlocal complete=w
|
setlocal complete=w
|
||||||
call feedkeys("itw\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>", 'xt')
|
call feedkeys("itw\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>", 'xt')
|
||||||
call assert_equal('two three four', getline(1))
|
call assert_equal('two three four', getline(1))
|
||||||
close!
|
bw!
|
||||||
" complete words from the current buffer
|
" complete words from the current buffer
|
||||||
setlocal complete=.
|
setlocal complete=.
|
||||||
%d
|
%d
|
||||||
@@ -1340,7 +1340,7 @@ func Test_complete_wrapscan()
|
|||||||
call cursor(2, 1)
|
call cursor(2, 1)
|
||||||
call feedkeys("ion\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>", 'xt')
|
call feedkeys("ion\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>", 'xt')
|
||||||
call assert_equal('one two one two', getline(2))
|
call assert_equal('one two one two', getline(2))
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for completing special characters
|
" Test for completing special characters
|
||||||
@@ -1349,7 +1349,7 @@ func Test_complete_special_chars()
|
|||||||
call setline(1, 'int .*[-\^$ func float')
|
call setline(1, 'int .*[-\^$ func float')
|
||||||
call feedkeys("oin\<C-X>\<C-P>\<C-X>\<C-P>\<C-X>\<C-P>", 'xt')
|
call feedkeys("oin\<C-X>\<C-P>\<C-X>\<C-P>\<C-X>\<C-P>", 'xt')
|
||||||
call assert_equal('int .*[-\^$ func float', getline(2))
|
call assert_equal('int .*[-\^$ func float', getline(2))
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for completion when text is wrapped across lines.
|
" Test for completion when text is wrapped across lines.
|
||||||
@@ -1359,7 +1359,7 @@ func Test_complete_across_line()
|
|||||||
setlocal textwidth=20
|
setlocal textwidth=20
|
||||||
exe "normal 2G$a re\<C-X>\<C-P>\<C-X>\<C-P>\<C-X>\<C-P>\<C-X>\<C-P>"
|
exe "normal 2G$a re\<C-X>\<C-P>\<C-X>\<C-P>\<C-X>\<C-P>\<C-X>\<C-P>"
|
||||||
call assert_equal(['one two three red', 'green blue one'], getline(2, '$'))
|
call assert_equal(['one two three red', 'green blue one'], getline(2, '$'))
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for completing words with a '.' at the end of a word.
|
" Test for completing words with a '.' at the end of a word.
|
||||||
@@ -1390,7 +1390,7 @@ func Test_complete_add_onechar()
|
|||||||
exe "normal aWOR\<C-P>\<bs>\<bs>\<bs>\<bs>\<bs>\<bs>\<C-L>\<C-L>\<C-L>"
|
exe "normal aWOR\<C-P>\<bs>\<bs>\<bs>\<bs>\<bs>\<bs>\<C-L>\<C-L>\<C-L>"
|
||||||
call assert_equal('workh', getline(3))
|
call assert_equal('workh', getline(3))
|
||||||
set ignorecase& backspace&
|
set ignorecase& backspace&
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for using CTRL-X CTRL-L to complete whole lines lines
|
" Test for using CTRL-X CTRL-L to complete whole lines lines
|
||||||
@@ -1456,7 +1456,7 @@ func Test_complete_with_cindent()
|
|||||||
setlocal cinkeys+==while
|
setlocal cinkeys+==while
|
||||||
exe "normal Giwh\<C-P> "
|
exe "normal Giwh\<C-P> "
|
||||||
call assert_equal("\twhile ", getline('$'))
|
call assert_equal("\twhile ", getline('$'))
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for <CTRL-X> <CTRL-V> completion. Complete commands and functions
|
" Test for <CTRL-X> <CTRL-V> completion. Complete commands and functions
|
||||||
@@ -1479,7 +1479,7 @@ func Test_complete_cmdline()
|
|||||||
call delete('TestCommand2Test')
|
call delete('TestCommand2Test')
|
||||||
delcom TestCommand1
|
delcom TestCommand1
|
||||||
delcom TestCommand2
|
delcom TestCommand2
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for <CTRL-X> <CTRL-Z> stopping completion without changing the match
|
" Test for <CTRL-X> <CTRL-Z> stopping completion without changing the match
|
||||||
@@ -1528,7 +1528,7 @@ func Test_complete_stop()
|
|||||||
iunmap <F2>
|
iunmap <F2>
|
||||||
delfunc Save_mode1
|
delfunc Save_mode1
|
||||||
delfunc Save_mode2
|
delfunc Save_mode2
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for typing CTRL-R in insert completion mode to insert a register
|
" Test for typing CTRL-R in insert completion mode to insert a register
|
||||||
@@ -1604,7 +1604,7 @@ func Test_complete_from_unloadedbuf()
|
|||||||
call writefile(['def'], "Xfile2")
|
call writefile(['def'], "Xfile2")
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
edit Xfile2
|
edit Xfile2
|
||||||
new | close
|
new | bw
|
||||||
enew
|
enew
|
||||||
bunload Xfile1 Xfile2
|
bunload Xfile1 Xfile2
|
||||||
set complete=u
|
set complete=u
|
||||||
@@ -1643,7 +1643,7 @@ func Test_complete_from_unlistedbuf()
|
|||||||
call writefile(['def'], "Xfile2")
|
call writefile(['def'], "Xfile2")
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
edit Xfile2
|
edit Xfile2
|
||||||
new | close
|
new | bw
|
||||||
bdel Xfile1 Xfile2
|
bdel Xfile1 Xfile2
|
||||||
set complete=U
|
set complete=U
|
||||||
" complete from an unlisted buffer
|
" complete from an unlisted buffer
|
||||||
|
|||||||
Reference in New Issue
Block a user