mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.0625: too many delete() calls in tests
Problem: Too many delete() calls in tests. Solution: Use deferred delete where possible.
This commit is contained in:
parent
ac38ec7c7f
commit
7dd5a78b88
@ -79,7 +79,7 @@ func Test_imactivatefunc_imstatusfunc_callback_no_breaks_foldopen()
|
|||||||
call setline(1, ['{{{', 'abc', '}}}'])
|
call setline(1, ['{{{', 'abc', '}}}'])
|
||||||
%foldclose
|
%foldclose
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xscript')
|
call writefile(lines, 'Xscript', 'D')
|
||||||
let buf = RunVimInTerminal('-S Xscript', {})
|
let buf = RunVimInTerminal('-S Xscript', {})
|
||||||
call assert_notequal('abc', term_getline(buf, 2))
|
call assert_notequal('abc', term_getline(buf, 2))
|
||||||
call term_sendkeys(buf, "/abc\n")
|
call term_sendkeys(buf, "/abc\n")
|
||||||
@ -87,7 +87,6 @@ func Test_imactivatefunc_imstatusfunc_callback_no_breaks_foldopen()
|
|||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xscript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for using an lmap in insert mode
|
" Test for using an lmap in insert mode
|
||||||
|
@ -161,7 +161,7 @@ func Test_modeline_indent_expr()
|
|||||||
func GetIndent()
|
func GetIndent()
|
||||||
return line('.') * 2
|
return line('.') * 2
|
||||||
endfunc
|
endfunc
|
||||||
call writefile(['# vim: indentexpr=GetIndent()'], 'Xmlfile.txt')
|
call writefile(['# vim: indentexpr=GetIndent()'], 'Xmlfile.txt', 'D')
|
||||||
set modelineexpr
|
set modelineexpr
|
||||||
new Xmlfile.txt
|
new Xmlfile.txt
|
||||||
call assert_equal('GetIndent()', &indentexpr)
|
call assert_equal('GetIndent()', &indentexpr)
|
||||||
@ -172,7 +172,6 @@ func Test_modeline_indent_expr()
|
|||||||
delfunc GetIndent
|
delfunc GetIndent
|
||||||
let &modeline = modeline
|
let &modeline = modeline
|
||||||
close!
|
close!
|
||||||
call delete('Xmlfile.txt')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_indent_func_with_gq()
|
func Test_indent_func_with_gq()
|
||||||
|
@ -15,14 +15,14 @@ func Test_ins_complete()
|
|||||||
set ff=unix
|
set ff=unix
|
||||||
call writefile(["test11\t36Gepeto\t/Tag/",
|
call writefile(["test11\t36Gepeto\t/Tag/",
|
||||||
\ "asd\ttest11file\t36G",
|
\ "asd\ttest11file\t36G",
|
||||||
\ "Makefile\tto\trun"], 'Xtestfile')
|
\ "Makefile\tto\trun"], 'Xtestfile', 'D')
|
||||||
call writefile(['', 'start of testfile',
|
call writefile(['', 'start of testfile',
|
||||||
\ 'ru',
|
\ 'ru',
|
||||||
\ 'run1',
|
\ 'run1',
|
||||||
\ 'run2',
|
\ 'run2',
|
||||||
\ 'STARTTEST',
|
\ 'STARTTEST',
|
||||||
\ 'ENDTEST',
|
\ 'ENDTEST',
|
||||||
\ 'end of testfile'], 'Xtestdata')
|
\ 'end of testfile'], 'Xtestdata', 'D')
|
||||||
set ff&
|
set ff&
|
||||||
|
|
||||||
enew!
|
enew!
|
||||||
@ -99,10 +99,8 @@ func Test_ins_complete()
|
|||||||
call assert_equal('asd', getline('.'))
|
call assert_equal('asd', getline('.'))
|
||||||
|
|
||||||
%bw!
|
%bw!
|
||||||
call delete('Xtestfile')
|
|
||||||
call delete('Xtest11.one')
|
call delete('Xtest11.one')
|
||||||
call delete('Xtest11.two')
|
call delete('Xtest11.two')
|
||||||
call delete('Xtestdata')
|
|
||||||
set cpt& cot& def& tags& tagbsearch& hidden&
|
set cpt& cot& def& tags& tagbsearch& hidden&
|
||||||
cd ..
|
cd ..
|
||||||
call delete('Xcpldir', 'rf')
|
call delete('Xcpldir', 'rf')
|
||||||
@ -111,13 +109,11 @@ endfunc
|
|||||||
func Test_ins_complete_invalid_byte()
|
func Test_ins_complete_invalid_byte()
|
||||||
if has('unix') && executable('base64')
|
if has('unix') && executable('base64')
|
||||||
" this weird command was causing an illegal memory access
|
" this weird command was causing an illegal memory access
|
||||||
call writefile(['bm9ybTlvMDCAMM4Dbw4OGA4ODg=='], 'Xinvalid64')
|
call writefile(['bm9ybTlvMDCAMM4Dbw4OGA4ODg=='], 'Xinvalid64', 'D')
|
||||||
call system('base64 -d Xinvalid64 > Xinvalid')
|
call system('base64 -d Xinvalid64 > Xinvalid')
|
||||||
call writefile(['qa!'], 'Xexit')
|
call writefile(['qa!'], 'Xexit', 'D')
|
||||||
call RunVim([], [], " -i NONE -n -X -Z -e -m -s -S Xinvalid -S Xexit")
|
call RunVim([], [], " -i NONE -n -X -Z -e -m -s -S Xinvalid -S Xexit")
|
||||||
call delete('Xinvalid64')
|
|
||||||
call delete('Xinvalid')
|
call delete('Xinvalid')
|
||||||
call delete('Xexit')
|
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -168,7 +164,7 @@ func Test_omni_autoload()
|
|||||||
let save_rtp = &rtp
|
let save_rtp = &rtp
|
||||||
set rtp=Xruntime/some
|
set rtp=Xruntime/some
|
||||||
let dir = 'Xruntime/some/autoload'
|
let dir = 'Xruntime/some/autoload'
|
||||||
call mkdir(dir, 'p')
|
call mkdir(dir, 'pR')
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
@ -190,7 +186,6 @@ func Test_omni_autoload()
|
|||||||
call feedkeys("i\<C-X>\<C-O>\<Esc>", 'xt')
|
call feedkeys("i\<C-X>\<C-O>\<Esc>", 'xt')
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
call delete('Xruntime', 'rf')
|
|
||||||
set omnifunc=
|
set omnifunc=
|
||||||
let &rtp = save_rtp
|
let &rtp = save_rtp
|
||||||
endfunc
|
endfunc
|
||||||
@ -433,7 +428,7 @@ endfunc
|
|||||||
func Test_ins_completeslash()
|
func Test_ins_completeslash()
|
||||||
CheckMSWindows
|
CheckMSWindows
|
||||||
|
|
||||||
call mkdir('Xcpldir')
|
call mkdir('Xcpldir', 'R')
|
||||||
let orig_shellslash = &shellslash
|
let orig_shellslash = &shellslash
|
||||||
set cpt&
|
set cpt&
|
||||||
new
|
new
|
||||||
@ -466,7 +461,6 @@ func Test_ins_completeslash()
|
|||||||
exe "normal oXcp\<C-X>\<C-F>"
|
exe "normal oXcp\<C-X>\<C-F>"
|
||||||
call assert_equal('Xcpldir/', getline('.'))
|
call assert_equal('Xcpldir/', getline('.'))
|
||||||
%bw!
|
%bw!
|
||||||
call delete('Xcpldir', 'rf')
|
|
||||||
|
|
||||||
set noshellslash
|
set noshellslash
|
||||||
set completeslash=slash
|
set completeslash=slash
|
||||||
@ -487,7 +481,7 @@ func Test_pum_stopped_by_timer()
|
|||||||
endfunc
|
endfunc
|
||||||
END
|
END
|
||||||
|
|
||||||
call writefile(lines, 'Xpumscript')
|
call writefile(lines, 'Xpumscript', 'D')
|
||||||
let buf = RunVimInTerminal('-S Xpumscript', #{rows: 12})
|
let buf = RunVimInTerminal('-S Xpumscript', #{rows: 12})
|
||||||
call term_sendkeys(buf, ":call StartCompl()\<CR>")
|
call term_sendkeys(buf, ":call StartCompl()\<CR>")
|
||||||
call TermWait(buf, 200)
|
call TermWait(buf, 200)
|
||||||
@ -495,7 +489,6 @@ func Test_pum_stopped_by_timer()
|
|||||||
call VerifyScreenDump(buf, 'Test_pum_stopped_by_timer', {})
|
call VerifyScreenDump(buf, 'Test_pum_stopped_by_timer', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xpumscript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_complete_stopinsert_startinsert()
|
func Test_complete_stopinsert_startinsert()
|
||||||
@ -520,7 +513,7 @@ func Test_pum_with_folds_two_tabs()
|
|||||||
call feedkeys("0fa", 'xt')
|
call feedkeys("0fa", 'xt')
|
||||||
END
|
END
|
||||||
|
|
||||||
call writefile(lines, 'Xpumscript')
|
call writefile(lines, 'Xpumscript', 'D')
|
||||||
let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10})
|
let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10})
|
||||||
call TermWait(buf, 50)
|
call TermWait(buf, 50)
|
||||||
call term_sendkeys(buf, "a\<C-N>")
|
call term_sendkeys(buf, "a\<C-N>")
|
||||||
@ -528,7 +521,6 @@ func Test_pum_with_folds_two_tabs()
|
|||||||
|
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xpumscript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_pum_with_preview_win()
|
func Test_pum_with_preview_win()
|
||||||
@ -545,7 +537,7 @@ func Test_pum_with_preview_win()
|
|||||||
set completeopt+=longest
|
set completeopt+=longest
|
||||||
END
|
END
|
||||||
|
|
||||||
call writefile(lines, 'Xpreviewscript')
|
call writefile(lines, 'Xpreviewscript', 'D')
|
||||||
let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12})
|
let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12})
|
||||||
call term_sendkeys(buf, "Gi\<C-X>\<C-O>")
|
call term_sendkeys(buf, "Gi\<C-X>\<C-O>")
|
||||||
call TermWait(buf, 200)
|
call TermWait(buf, 200)
|
||||||
@ -554,7 +546,6 @@ func Test_pum_with_preview_win()
|
|||||||
|
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xpreviewscript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_scrollbar_on_wide_char()
|
func Test_scrollbar_on_wide_char()
|
||||||
@ -566,13 +557,12 @@ func Test_scrollbar_on_wide_char()
|
|||||||
\ ' 呃呃呃'])
|
\ ' 呃呃呃'])
|
||||||
call setline(5, range(10)->map({i, v -> 'aa' .. v .. 'bb'}))
|
call setline(5, range(10)->map({i, v -> 'aa' .. v .. 'bb'}))
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xwidescript')
|
call writefile(lines, 'Xwidescript', 'D')
|
||||||
let buf = RunVimInTerminal('-S Xwidescript', #{rows: 10})
|
let buf = RunVimInTerminal('-S Xwidescript', #{rows: 10})
|
||||||
call term_sendkeys(buf, "A\<C-N>")
|
call term_sendkeys(buf, "A\<C-N>")
|
||||||
call VerifyScreenDump(buf, 'Test_scrollbar_on_wide_char', {})
|
call VerifyScreenDump(buf, 'Test_scrollbar_on_wide_char', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xwidescript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for inserting the tag search pattern in insert mode
|
" Test for inserting the tag search pattern in insert mode
|
||||||
@ -582,14 +572,14 @@ func Test_ins_compl_tag_sft()
|
|||||||
\ "first\tXfoo\t/^int first() {}$/",
|
\ "first\tXfoo\t/^int first() {}$/",
|
||||||
\ "second\tXfoo\t/^int second() {}$/",
|
\ "second\tXfoo\t/^int second() {}$/",
|
||||||
\ "third\tXfoo\t/^int third() {}$/"],
|
\ "third\tXfoo\t/^int third() {}$/"],
|
||||||
\ 'Xtags')
|
\ 'Xtags', 'D')
|
||||||
set tags=Xtags
|
set tags=Xtags
|
||||||
let code =<< trim [CODE]
|
let code =<< trim [CODE]
|
||||||
int first() {}
|
int first() {}
|
||||||
int second() {}
|
int second() {}
|
||||||
int third() {}
|
int third() {}
|
||||||
[CODE]
|
[CODE]
|
||||||
call writefile(code, 'Xfoo')
|
call writefile(code, 'Xfoo', 'D')
|
||||||
|
|
||||||
enew
|
enew
|
||||||
set showfulltag
|
set showfulltag
|
||||||
@ -597,8 +587,6 @@ func Test_ins_compl_tag_sft()
|
|||||||
call assert_equal('int second() {}', getline(1))
|
call assert_equal('int second() {}', getline(1))
|
||||||
set noshowfulltag
|
set noshowfulltag
|
||||||
|
|
||||||
call delete('Xtags')
|
|
||||||
call delete('Xfoo')
|
|
||||||
set tags&
|
set tags&
|
||||||
%bwipe!
|
%bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
@ -978,8 +966,8 @@ endfunc
|
|||||||
|
|
||||||
" Test for completing words from unloaded buffers
|
" Test for completing words from unloaded buffers
|
||||||
func Test_complete_from_unloadedbuf()
|
func Test_complete_from_unloadedbuf()
|
||||||
call writefile(['abc'], "Xfile1")
|
call writefile(['abc'], "Xfile1", 'D')
|
||||||
call writefile(['def'], "Xfile2")
|
call writefile(['def'], "Xfile2", 'D')
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
edit Xfile2
|
edit Xfile2
|
||||||
new | close
|
new | close
|
||||||
@ -991,15 +979,14 @@ func Test_complete_from_unloadedbuf()
|
|||||||
call assert_equal('abc', getline(1))
|
call assert_equal('abc', getline(1))
|
||||||
exe "normal! od\<C-P>"
|
exe "normal! od\<C-P>"
|
||||||
call assert_equal('def', getline(2))
|
call assert_equal('def', getline(2))
|
||||||
|
|
||||||
set complete&
|
set complete&
|
||||||
%bw!
|
%bw!
|
||||||
call delete("Xfile1")
|
|
||||||
call delete("Xfile2")
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for completing whole lines from unloaded buffers
|
" Test for completing whole lines from unloaded buffers
|
||||||
func Test_complete_wholeline_unloadedbuf()
|
func Test_complete_wholeline_unloadedbuf()
|
||||||
call writefile(['a line1', 'a line2', 'a line3'], "Xfile1")
|
call writefile(['a line1', 'a line2', 'a line3'], "Xfile1", 'D')
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
enew
|
enew
|
||||||
set complete=u
|
set complete=u
|
||||||
@ -1010,15 +997,15 @@ func Test_complete_wholeline_unloadedbuf()
|
|||||||
bdel Xfile1
|
bdel Xfile1
|
||||||
exe "normal! ia\<C-X>\<C-L>\<C-P>"
|
exe "normal! ia\<C-X>\<C-L>\<C-P>"
|
||||||
call assert_equal('a', getline(1))
|
call assert_equal('a', getline(1))
|
||||||
|
|
||||||
set complete&
|
set complete&
|
||||||
%bw!
|
%bw!
|
||||||
call delete("Xfile1")
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for completing words from unlisted buffers
|
" Test for completing words from unlisted buffers
|
||||||
func Test_complete_from_unlistedbuf()
|
func Test_complete_from_unlistedbuf()
|
||||||
call writefile(['abc'], "Xfile1")
|
call writefile(['abc'], "Xfile1", 'D')
|
||||||
call writefile(['def'], "Xfile2")
|
call writefile(['def'], "Xfile2", 'D')
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
edit Xfile2
|
edit Xfile2
|
||||||
new | close
|
new | close
|
||||||
@ -1029,15 +1016,14 @@ func Test_complete_from_unlistedbuf()
|
|||||||
call assert_equal('abc', getline(1))
|
call assert_equal('abc', getline(1))
|
||||||
exe "normal! od\<C-P>"
|
exe "normal! od\<C-P>"
|
||||||
call assert_equal('def', getline(2))
|
call assert_equal('def', getline(2))
|
||||||
|
|
||||||
set complete&
|
set complete&
|
||||||
%bw!
|
%bw!
|
||||||
call delete("Xfile1")
|
|
||||||
call delete("Xfile2")
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for completing whole lines from unlisted buffers
|
" Test for completing whole lines from unlisted buffers
|
||||||
func Test_complete_wholeline_unlistedbuf()
|
func Test_complete_wholeline_unlistedbuf()
|
||||||
call writefile(['a line1', 'a line2', 'a line3'], "Xfile1")
|
call writefile(['a line1', 'a line2', 'a line3'], "Xfile1", 'D')
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
enew
|
enew
|
||||||
set complete=U
|
set complete=U
|
||||||
@ -1048,9 +1034,9 @@ func Test_complete_wholeline_unlistedbuf()
|
|||||||
bdel Xfile1
|
bdel Xfile1
|
||||||
exe "normal! ia\<C-X>\<C-L>\<C-P>"
|
exe "normal! ia\<C-X>\<C-L>\<C-P>"
|
||||||
call assert_equal('a line2', getline(1))
|
call assert_equal('a line2', getline(1))
|
||||||
|
|
||||||
set complete&
|
set complete&
|
||||||
%bw!
|
%bw!
|
||||||
call delete("Xfile1")
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for adding a multibyte character using CTRL-L in completion mode
|
" Test for adding a multibyte character using CTRL-L in completion mode
|
||||||
@ -1246,14 +1232,14 @@ func Test_complete_unreadable_thesaurus_file()
|
|||||||
CheckUnix
|
CheckUnix
|
||||||
CheckNotRoot
|
CheckNotRoot
|
||||||
|
|
||||||
call writefile(['about', 'above'], 'Xunrfile')
|
call writefile(['about', 'above'], 'Xunrfile', 'D')
|
||||||
call setfperm('Xunrfile', '---r--r--')
|
call setfperm('Xunrfile', '---r--r--')
|
||||||
new
|
new
|
||||||
set complete=sXfile
|
set complete=sXfile
|
||||||
exe "normal! ia\<C-P>"
|
exe "normal! ia\<C-P>"
|
||||||
call assert_equal('a', getline(1))
|
call assert_equal('a', getline(1))
|
||||||
|
|
||||||
bw!
|
bw!
|
||||||
call delete('Xunrfile')
|
|
||||||
set complete&
|
set complete&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ func Test_getjumplist()
|
|||||||
for i in range(1, 100)
|
for i in range(1, 100)
|
||||||
call add(lines, "Line " . i)
|
call add(lines, "Line " . i)
|
||||||
endfor
|
endfor
|
||||||
call writefile(lines, "Xtest")
|
call writefile(lines, "Xtest", 'D')
|
||||||
|
|
||||||
" Jump around and create a jump list
|
" Jump around and create a jump list
|
||||||
edit Xtest
|
edit Xtest
|
||||||
@ -57,8 +57,6 @@ func Test_getjumplist()
|
|||||||
clearjumps
|
clearjumps
|
||||||
call test_garbagecollect_now()
|
call test_garbagecollect_now()
|
||||||
call assert_equal(4, l[1])
|
call assert_equal(4, l[1])
|
||||||
|
|
||||||
call delete("Xtest")
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_jumplist_invalid()
|
func Test_jumplist_invalid()
|
||||||
|
@ -354,7 +354,7 @@ func Test_closure_error()
|
|||||||
return 1
|
return 1
|
||||||
endfunc
|
endfunc
|
||||||
END
|
END
|
||||||
call writefile(l, 'Xscript')
|
call writefile(l, 'Xscript', 'D')
|
||||||
let caught_932 = 0
|
let caught_932 = 0
|
||||||
try
|
try
|
||||||
source Xscript
|
source Xscript
|
||||||
@ -362,7 +362,6 @@ func Test_closure_error()
|
|||||||
let caught_932 = 1
|
let caught_932 = 1
|
||||||
endtry
|
endtry
|
||||||
call assert_equal(1, caught_932)
|
call assert_equal(1, caught_932)
|
||||||
call delete('Xscript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -344,36 +344,31 @@ func Test_let_heredoc_fails()
|
|||||||
let v =<< that there
|
let v =<< that there
|
||||||
endfunc
|
endfunc
|
||||||
END
|
END
|
||||||
call writefile(text, 'XheredocFail')
|
call writefile(text, 'XheredocFail', 'D')
|
||||||
call assert_fails('source XheredocFail', 'E1145:')
|
call assert_fails('source XheredocFail', 'E1145:')
|
||||||
call delete('XheredocFail')
|
|
||||||
|
|
||||||
let text =<< trim CodeEnd
|
let text =<< trim CodeEnd
|
||||||
func MissingEnd()
|
func MissingEnd()
|
||||||
let v =<< END
|
let v =<< END
|
||||||
endfunc
|
endfunc
|
||||||
CodeEnd
|
CodeEnd
|
||||||
call writefile(text, 'XheredocWrong')
|
call writefile(text, 'XheredocWrong', 'D')
|
||||||
call assert_fails('source XheredocWrong', 'E1145:')
|
call assert_fails('source XheredocWrong', 'E1145:')
|
||||||
call delete('XheredocWrong')
|
|
||||||
|
|
||||||
let text =<< trim TEXTend
|
let text =<< trim TEXTend
|
||||||
let v =<< " comment
|
let v =<< " comment
|
||||||
TEXTend
|
TEXTend
|
||||||
call writefile(text, 'XheredocNoMarker')
|
call writefile(text, 'XheredocNoMarker', 'D')
|
||||||
call assert_fails('source XheredocNoMarker', 'E172:')
|
call assert_fails('source XheredocNoMarker', 'E172:')
|
||||||
call delete('XheredocNoMarker')
|
|
||||||
|
|
||||||
let text =<< trim TEXTend
|
let text =<< trim TEXTend
|
||||||
let v =<< text
|
let v =<< text
|
||||||
TEXTend
|
TEXTend
|
||||||
call writefile(text, 'XheredocBadMarker')
|
call writefile(text, 'XheredocBadMarker', 'D')
|
||||||
call assert_fails('source XheredocBadMarker', 'E221:')
|
call assert_fails('source XheredocBadMarker', 'E221:')
|
||||||
call delete('XheredocBadMarker')
|
|
||||||
|
|
||||||
call writefile(['let v =<< TEXT', 'abc'], 'XheredocMissingMarker')
|
call writefile(['let v =<< TEXT', 'abc'], 'XheredocMissingMarker', 'D')
|
||||||
call assert_fails('source XheredocMissingMarker', 'E990:')
|
call assert_fails('source XheredocMissingMarker', 'E990:')
|
||||||
call delete('XheredocMissingMarker')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_let_heredoc_trim_no_indent_marker()
|
func Test_let_heredoc_trim_no_indent_marker()
|
||||||
|
@ -664,7 +664,7 @@ func Test_listchars_foldcolumn()
|
|||||||
vsplit
|
vsplit
|
||||||
windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:<
|
windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:<
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XTest_listchars')
|
call writefile(lines, 'XTest_listchars', 'D')
|
||||||
|
|
||||||
let buf = RunVimInTerminal('-S XTest_listchars', {'rows': 10, 'cols': 60})
|
let buf = RunVimInTerminal('-S XTest_listchars', {'rows': 10, 'cols': 60})
|
||||||
|
|
||||||
@ -687,7 +687,6 @@ func Test_listchars_foldcolumn()
|
|||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XTest_listchars')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
@ -817,8 +817,7 @@ endfunc
|
|||||||
|
|
||||||
" Test :luafile foo.lua
|
" Test :luafile foo.lua
|
||||||
func Test_luafile()
|
func Test_luafile()
|
||||||
call delete('Xlua_file')
|
call writefile(["str = 'hello'", "num = 123" ], 'Xlua_file', 'D')
|
||||||
call writefile(["str = 'hello'", "num = 123" ], 'Xlua_file')
|
|
||||||
call setfperm('Xlua_file', 'r-xr-xr-x')
|
call setfperm('Xlua_file', 'r-xr-xr-x')
|
||||||
|
|
||||||
luafile Xlua_file
|
luafile Xlua_file
|
||||||
@ -826,7 +825,6 @@ func Test_luafile()
|
|||||||
call assert_equal(123, luaeval('num'))
|
call assert_equal(123, luaeval('num'))
|
||||||
|
|
||||||
lua str, num = nil
|
lua str, num = nil
|
||||||
call delete('Xlua_file')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test :luafile %
|
" Test :luafile %
|
||||||
@ -849,12 +847,11 @@ endfunc
|
|||||||
" Test :luafile with syntax error
|
" Test :luafile with syntax error
|
||||||
func Test_luafile_error()
|
func Test_luafile_error()
|
||||||
new Xlua_file
|
new Xlua_file
|
||||||
call writefile(['nil = 0' ], 'Xlua_file')
|
call writefile(['nil = 0' ], 'Xlua_file', 'D')
|
||||||
call setfperm('Xlua_file', 'r-xr-xr-x')
|
call setfperm('Xlua_file', 'r-xr-xr-x')
|
||||||
|
|
||||||
call assert_fails('luafile Xlua_file', "Xlua_file:1: unexpected symbol near 'nil'")
|
call assert_fails('luafile Xlua_file', "Xlua_file:1: unexpected symbol near 'nil'")
|
||||||
|
|
||||||
call delete('Xlua_file')
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@ -758,7 +758,7 @@ func Test_popup_and_previewwindow_dump()
|
|||||||
call setline(1, map(repeat(["ab"], 10), "v:val .. v:key"))
|
call setline(1, map(repeat(["ab"], 10), "v:val .. v:key"))
|
||||||
exec "norm! G\<C-E>\<C-E>"
|
exec "norm! G\<C-E>\<C-E>"
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xscript')
|
call writefile(lines, 'Xscript', 'D')
|
||||||
let buf = RunVimInTerminal('-S Xscript', {})
|
let buf = RunVimInTerminal('-S Xscript', {})
|
||||||
|
|
||||||
" wait for the script to finish
|
" wait for the script to finish
|
||||||
@ -772,7 +772,6 @@ func Test_popup_and_previewwindow_dump()
|
|||||||
|
|
||||||
call term_sendkeys(buf, "\<Esc>u")
|
call term_sendkeys(buf, "\<Esc>u")
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xscript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_balloon_split()
|
func Test_balloon_split()
|
||||||
@ -829,7 +828,7 @@ func Test_popup_position()
|
|||||||
123456789_123456789_123456789_b
|
123456789_123456789_123456789_b
|
||||||
123
|
123
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xtest')
|
call writefile(lines, 'Xtest', 'D')
|
||||||
let buf = RunVimInTerminal('Xtest', {})
|
let buf = RunVimInTerminal('Xtest', {})
|
||||||
call term_sendkeys(buf, ":vsplit\<CR>")
|
call term_sendkeys(buf, ":vsplit\<CR>")
|
||||||
|
|
||||||
@ -860,7 +859,6 @@ func Test_popup_position()
|
|||||||
|
|
||||||
call term_sendkeys(buf, "\<Esc>u")
|
call term_sendkeys(buf, "\<Esc>u")
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xtest')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_popup_command()
|
func Test_popup_command()
|
||||||
@ -883,14 +881,14 @@ func Test_popup_command()
|
|||||||
echomsg 'changed'
|
echomsg 'changed'
|
||||||
endfunc
|
endfunc
|
||||||
END
|
END
|
||||||
call writefile(script, 'XtimerScript')
|
call writefile(script, 'XtimerScript', 'D')
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
one two three four five
|
one two three four five
|
||||||
and one two Xthree four five
|
and one two Xthree four five
|
||||||
one more two three four five
|
one more two three four five
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xtest')
|
call writefile(lines, 'Xtest', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtimerScript Xtest', {})
|
let buf = RunVimInTerminal('-S XtimerScript Xtest', {})
|
||||||
call term_sendkeys(buf, ":source $VIMRUNTIME/menu.vim\<CR>")
|
call term_sendkeys(buf, ":source $VIMRUNTIME/menu.vim\<CR>")
|
||||||
call term_sendkeys(buf, "/X\<CR>:popup PopUp\<CR>")
|
call term_sendkeys(buf, "/X\<CR>:popup PopUp\<CR>")
|
||||||
@ -917,8 +915,6 @@ func Test_popup_command()
|
|||||||
call VerifyScreenDump(buf, 'Test_popup_command_05', {})
|
call VerifyScreenDump(buf, 'Test_popup_command_05', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xtest')
|
|
||||||
call delete('XtimerScript')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_popup_complete_backwards()
|
func Test_popup_complete_backwards()
|
||||||
@ -1013,7 +1009,7 @@ func Test_popup_complete_info_01()
|
|||||||
inoremap <buffer><F6> <C-R>=s:complTestEval()<CR>
|
inoremap <buffer><F6> <C-R>=s:complTestEval()<CR>
|
||||||
call writefile([
|
call writefile([
|
||||||
\ 'dummy dummy.txt 1',
|
\ 'dummy dummy.txt 1',
|
||||||
\], 'Xdummy.txt')
|
\], 'Xdummy.txt', 'D')
|
||||||
setlocal tags=Xdummy.txt
|
setlocal tags=Xdummy.txt
|
||||||
setlocal dictionary=Xdummy.txt
|
setlocal dictionary=Xdummy.txt
|
||||||
setlocal thesaurus=Xdummy.txt
|
setlocal thesaurus=Xdummy.txt
|
||||||
@ -1046,7 +1042,7 @@ func Test_popup_complete_info_01()
|
|||||||
call assert_equal(mode_name, getline('.'))
|
call assert_equal(mode_name, getline('.'))
|
||||||
%d
|
%d
|
||||||
endfor
|
endfor
|
||||||
call delete('Xdummy.txt')
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -1194,7 +1190,7 @@ func Test_pum_rightleft()
|
|||||||
vim
|
vim
|
||||||
victory
|
victory
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xtest1')
|
call writefile(lines, 'Xtest1', 'D')
|
||||||
let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {})
|
let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {})
|
||||||
call term_sendkeys(buf, "Go\<C-P>")
|
call term_sendkeys(buf, "Go\<C-P>")
|
||||||
call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8})
|
call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8})
|
||||||
@ -1209,7 +1205,7 @@ func Test_pum_rightleft()
|
|||||||
one three
|
one three
|
||||||
four
|
four
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xtest2')
|
call writefile(lines, 'Xtest2', 'D')
|
||||||
call term_sendkeys(buf, "\<Esc>:e! Xtest2\<CR>")
|
call term_sendkeys(buf, "\<Esc>:e! Xtest2\<CR>")
|
||||||
call TermWait(buf, 30)
|
call TermWait(buf, 30)
|
||||||
call term_sendkeys(buf, "Goone\<C-X>\<C-L>")
|
call term_sendkeys(buf, "Goone\<C-X>\<C-L>")
|
||||||
@ -1222,8 +1218,6 @@ func Test_pum_rightleft()
|
|||||||
call WaitForAssert({-> assert_match('\s*eerht eno', Screenline(4))})
|
call WaitForAssert({-> assert_match('\s*eerht eno', Screenline(4))})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xtest1')
|
|
||||||
call delete('Xtest2')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for a popup menu with a scrollbar
|
" Test for a popup menu with a scrollbar
|
||||||
@ -1234,7 +1228,7 @@ func Test_pum_scrollbar()
|
|||||||
two
|
two
|
||||||
three
|
three
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xtest1')
|
call writefile(lines, 'Xtest1', 'D')
|
||||||
let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {})
|
let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {})
|
||||||
call TermWait(buf)
|
call TermWait(buf)
|
||||||
call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
|
call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
|
||||||
@ -1250,7 +1244,6 @@ func Test_pum_scrollbar()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xtest1')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
625,
|
||||||
/**/
|
/**/
|
||||||
624,
|
624,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user