I wrote:
> Patch 9.0.0418
> Problem: Manually deleting temp test files.
> Solution: Use the 'D' flag of writefile() and mkdir().
> Files: src/testdir/test_cd.vim, src/testdir/test_changelist.vim,
> src/testdir/test_channel.vim, src/testdir/test_checkpath.vim,
> src/testdir/test_cmdline.vim, src/testdir/test_cmdwin.vim,
> src/testdir/test_conceal.vim, src/testdir/test_cpoptions.vim,
> src/testdir/test_cscope.vim, src/testdir/test_cursorline.vim
>
>
> *** ../vim-9.0.0418/src/userfunc.c 2022-09-07 21:30:40.139379052 +0100
> --- src/userfunc.c 2022-09-08 18:11:09.503285696 +0100
That's the wrong diff. This should be the right one:
*** ../vim-9.0.0417/src/testdir/test_cd.vim 2022-08-29 22:31:15.919685279 +0100
--- src/testdir/test_cd.vim 2022-09-08 16:33:06.829221261 +0100
***************
*** 58,75 ****
call writefile(v:errors, 'Xresult')
qall!
[SCRIPT]
! call writefile(lines, 'Xscript')
if RunVim([], [], '--clean -S Xscript')
call assert_equal([], readfile('Xresult'))
endif
- call delete('Xscript')
call delete('Xresult')
endfunc
" Test for chdir()
func Test_chdir_func()
let topdir = getcwd()
! call mkdir('Xchdir/y/z', 'p')
" Create a few tabpages and windows with different directories
new
--- 58,74 ----
call writefile(v:errors, 'Xresult')
qall!
[SCRIPT]
! call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '--clean -S Xscript')
call assert_equal([], readfile('Xresult'))
endif
call delete('Xresult')
endfunc
" Test for chdir()
func Test_chdir_func()
let topdir = getcwd()
! call mkdir('Xchdir/y/z', 'pR')
" Create a few tabpages and windows with different directories
new
***************
*** 110,122 ****
only | tabonly
call chdir(topdir)
- call delete('Xchdir', 'rf')
endfunc
" Test for changing to the previous directory '-'
func Test_prev_dir()
let topdir = getcwd()
! call mkdir('Xprevdir/a/b/c', 'p')
" Create a few tabpages and windows with different directories
new | only
--- 109,120 ----
only | tabonly
call chdir(topdir)
endfunc
" Test for changing to the previous directory '-'
func Test_prev_dir()
let topdir = getcwd()
! call mkdir('Xprevdir/a/b/c', 'pR')
" Create a few tabpages and windows with different directories
new | only
***************
*** 173,179 ****
only | tabonly
call chdir(topdir)
- call delete('Xprevdir', 'rf')
endfunc
func Test_lcd_split()
--- 171,176 ----
***************
*** 201,222 ****
endfunc
func Test_cd_completion()
! call mkdir('XComplDir1', 'p')
! call mkdir('XComplDir2', 'p')
! call writefile([], 'XComplFile')
for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir']
call feedkeys(':' .. cmd .. " XCompl\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"' .. cmd .. ' XComplDir1/ XComplDir2/', @:)
endfor
-
- call delete('XComplDir1', 'd')
- call delete('XComplDir2', 'd')
- call delete('XComplFile')
endfunc
func Test_cd_unknown_dir()
! call mkdir('Xa')
cd Xa
call writefile(['text'], 'Xb.txt')
edit Xa/Xb.txt
--- 198,215 ----
endfunc
func Test_cd_completion()
! call mkdir('XComplDir1', 'D')
! call mkdir('XComplDir2', 'D')
! call writefile([], 'XComplFile', 'D')
for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir']
call feedkeys(':' .. cmd .. " XCompl\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"' .. cmd .. ' XComplDir1/ XComplDir2/', @:)
endfor
endfunc
func Test_cd_unknown_dir()
! call mkdir('Xa', 'R')
cd Xa
call writefile(['text'], 'Xb.txt')
edit Xa/Xb.txt
***************
*** 229,242 ****
bwipe!
exe "bwipe! " .. first_buf
- call delete('Xa', 'rf')
endfunc
func Test_getcwd_actual_dir()
CheckOption autochdir
let startdir = getcwd()
! call mkdir('Xactual')
call test_autochdir()
set autochdir
edit Xactual/file.txt
--- 222,234 ----
bwipe!
exe "bwipe! " .. first_buf
endfunc
func Test_getcwd_actual_dir()
CheckOption autochdir
let startdir = getcwd()
! call mkdir('Xactual', 'R')
call test_autochdir()
set autochdir
edit Xactual/file.txt
***************
*** 250,256 ****
set noautochdir
bwipe!
call chdir(startdir)
- call delete('Xactual', 'rf')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
--- 242,247 ----
*** ../vim-9.0.0417/src/testdir/test_changelist.vim 2022-08-30 21:46:03.657214444 +0100
--- src/testdir/test_changelist.vim 2022-09-08 16:33:49.105193035 +0100
***************
*** 64,71 ****
call assert_equal([], 10->getchangelist())
call assert_equal([[], 0], getchangelist())
! call writefile(['line1', 'line2', 'line3'], 'Xclistfile1.txt')
! call writefile(['line1', 'line2', 'line3'], 'Xclistfile2.txt')
edit Xclistfile1.txt
let buf_1 = bufnr()
--- 64,71 ----
call assert_equal([], 10->getchangelist())
call assert_equal([[], 0], getchangelist())
! call writefile(['line1', 'line2', 'line3'], 'Xclistfile1.txt', 'D')
! call writefile(['line1', 'line2', 'line3'], 'Xclistfile2.txt', 'D')
edit Xclistfile1.txt
let buf_1 = bufnr()
***************
*** 100,107 ****
\ getchangelist(buf_2))
bwipe!
- call delete('Xclistfile1.txt')
- call delete('Xclistfile2.txt')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
--- 100,105 ----
*** ../vim-9.0.0417/src/testdir/test_channel.vim 2022-08-30 19:48:17.206760205 +0100
--- src/testdir/test_channel.vim 2022-09-08 16:15:23.413318159 +0100
***************
*** 714,720 ****
endfunc
func Test_nl_read_file()
! call writefile(['echo something', 'echoerr wrong', 'double this'], 'Xinput')
let g:job = job_start(s:python . " test_channel_pipe.py",
\ {'in_io': 'file', 'in_name': 'Xinput'})
call assert_equal("run", job_status(g:job))
--- 714,720 ----
endfunc
func Test_nl_read_file()
! call writefile(['echo something', 'echoerr wrong', 'double this'], 'Xinput', 'D')
let g:job = job_start(s:python . " test_channel_pipe.py",
\ {'in_io': 'file', 'in_name': 'Xinput'})
call assert_equal("run", job_status(g:job))
***************
*** 726,732 ****
call assert_equal("AND this", ch_readraw(handle))
finally
call Stop_g_job()
- call delete('Xinput')
endtry
call assert_fails("echo ch_read(test_null_channel(), {'callback' : 'abc'})", 'E475:')
endfunc
--- 726,731 ----
***************
*** 1161,1174 ****
endif
call job_start(cmd, #{out_io: 'buffer', out_name: 'Xscrollbuffer'})
END
! call writefile(lines, 'XtestBufferScroll')
let buf = RunVimInTerminal('-S XtestBufferScroll', #{rows: 10})
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_job_buffer_scroll_1', {})
" clean up
call StopVimInTerminal(buf)
- call delete('XtestBufferScroll')
endfunc
func Test_pipe_null()
--- 1160,1172 ----
endif
call job_start(cmd, #{out_io: 'buffer', out_name: 'Xscrollbuffer'})
END
! call writefile(lines, 'XtestBufferScroll', 'D')
let buf = RunVimInTerminal('-S XtestBufferScroll', #{rows: 10})
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_job_buffer_scroll_1', {})
" clean up
call StopVimInTerminal(buf)
endfunc
func Test_pipe_null()
***************
*** 2178,2184 ****
func Test_job_tty_in_out()
CheckUnix
! call writefile(['test'], 'Xtestin')
let in_opts = [{},
\ {'in_io': 'null'},
\ {'in_io': 'file', 'in_name': 'Xtestin'}]
--- 2176,2182 ----
func Test_job_tty_in_out()
CheckUnix
! call writefile(['test'], 'Xtestin', 'D')
let in_opts = [{},
\ {'in_io': 'null'},
\ {'in_io': 'file', 'in_name': 'Xtestin'}]
***************
*** 2220,2226 ****
call WaitForAssert({-> assert_equal('dead', job_status(job))})
endfor
- call delete('Xtestin')
call delete('Xtestout')
call delete('Xtesterr')
endfunc
--- 2218,2223 ----
***************
*** 2281,2289 ****
let text = readfile('Xlog')
call assert_match("hello there", text[1])
call assert_match("%s%s", text[2])
! call mkdir("Xchlogdir1")
call assert_fails("call ch_logfile('Xchlogdir1')", 'E484:')
! cal delete("Xchlogdir1", 'd')
call delete('Xlog')
endfunc
--- 2278,2286 ----
let text = readfile('Xlog')
call assert_match("hello there", text[1])
call assert_match("%s%s", text[2])
! call mkdir("Xchlogdir1", 'D')
call assert_fails("call ch_logfile('Xchlogdir1')", 'E484:')
!
call delete('Xlog')
endfunc
*** ../vim-9.0.0417/src/testdir/test_checkpath.vim 2022-08-29 22:31:15.919685279 +0100
--- src/testdir/test_checkpath.vim 2022-09-08 16:16:52.301354972 +0100
***************
*** 2,8 ****
" Test for 'include' without \zs or \ze
func Test_checkpath1()
! call mkdir("Xcheckdir1/dir2", "p")
call writefile(['#include "bar.a"'], 'Xcheckdir1/dir2/foo.a')
call writefile(['#include "baz.a"'], 'Xcheckdir1/dir2/bar.a')
call writefile(['#include "foo.a"'], 'Xcheckdir1/dir2/baz.a')
--- 2,8 ----
" Test for 'include' without \zs or \ze
func Test_checkpath1()
! call mkdir("Xcheckdir1/dir2", "pR")
call writefile(['#include "bar.a"'], 'Xcheckdir1/dir2/foo.a')
call writefile(['#include "baz.a"'], 'Xcheckdir1/dir2/bar.a')
call writefile(['#include "foo.a"'], 'Xcheckdir1/dir2/baz.a')
***************
*** 23,29 ****
enew
call delete("./Xbase.a")
- call delete("Xcheckdir1", "rf")
set path&
endfunc
--- 23,28 ----
***************
*** 33,43 ****
" Test for 'include' with \zs and \ze
func Test_checkpath2()
! call mkdir("Xcheckdir2/dir2", "p")
call writefile(['%inc /bar/'], 'Xcheckdir2/dir2/foo.b')
call writefile(['%inc /baz/'], 'Xcheckdir2/dir2/bar.b')
call writefile(['%inc /foo/'], 'Xcheckdir2/dir2/baz.b')
! call writefile(['%inc /foo/'], 'Xbase.b')
let &include='^\s*%inc\s*/\zs[^/]\+\ze'
let &includeexpr='DotsToSlashes()'
--- 32,42 ----
" Test for 'include' with \zs and \ze
func Test_checkpath2()
! call mkdir("Xcheckdir2/dir2", "pR")
call writefile(['%inc /bar/'], 'Xcheckdir2/dir2/foo.b')
call writefile(['%inc /baz/'], 'Xcheckdir2/dir2/bar.b')
call writefile(['%inc /foo/'], 'Xcheckdir2/dir2/baz.b')
! call writefile(['%inc /foo/'], 'Xbase.b', 'D')
let &include='^\s*%inc\s*/\zs[^/]\+\ze'
let &includeexpr='DotsToSlashes()'
***************
*** 56,63 ****
\ ' foo (Already listed)'], res)
enew
- call delete("./Xbase.b")
- call delete("Xcheckdir2", "rf")
set path&
set include&
set includeexpr&
--- 55,60 ----
***************
*** 72,83 ****
" Test for 'include' with \zs and no \ze
func Test_checkpath3()
! call mkdir("Xcheckdir3/dir2", "p")
call writefile(['%inc bar.c'], 'Xcheckdir3/dir2/foo.c')
call writefile(['%inc baz.c'], 'Xcheckdir3/dir2/bar.c')
call writefile(['%inc foo.c'], 'Xcheckdir3/dir2/baz.c')
call writefile(['%inc foo.c'], 'Xcheckdir3/dir2/FALSE.c')
! call writefile(['%inc FALSE.c foo.c'], 'Xbase.c')
let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
let &includeexpr='StripNewlineChar()'
--- 69,80 ----
" Test for 'include' with \zs and no \ze
func Test_checkpath3()
! call mkdir("Xcheckdir3/dir2", "pR")
call writefile(['%inc bar.c'], 'Xcheckdir3/dir2/foo.c')
call writefile(['%inc baz.c'], 'Xcheckdir3/dir2/bar.c')
call writefile(['%inc foo.c'], 'Xcheckdir3/dir2/baz.c')
call writefile(['%inc foo.c'], 'Xcheckdir3/dir2/FALSE.c')
! call writefile(['%inc FALSE.c foo.c'], 'Xbase.c', 'D')
let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
let &includeexpr='StripNewlineChar()'
***************
*** 96,103 ****
\ ' foo.c (Already listed)'], res)
enew
- call delete("./Xbase.c")
- call delete("Xcheckdir3", "rf")
set path&
set include&
set includeexpr&
--- 93,98 ----
*** ../vim-9.0.0417/src/testdir/test_cmdline.vim 2022-09-02 19:45:12.215205522 +0100
--- src/testdir/test_cmdline.vim 2022-09-08 16:25:44.665361233 +0100
***************
*** 20,33 ****
endfunc
func Test_complete_tab()
! call writefile(['testfile'], 'Xtestfile')
call feedkeys(":e Xtest\t\r", "tx")
call assert_equal('testfile', getline(1))
" Pressing <Tab> after '%' completes the current file, also on MS-Windows
call feedkeys(":e %\t\r", "tx")
call assert_equal('e Xtestfile', @:)
- call delete('Xtestfile')
endfunc
func Test_complete_list()
--- 20,32 ----
endfunc
func Test_complete_tab()
! call writefile(['testfile'], 'Xtestfile', 'D')
call feedkeys(":e Xtest\t\r", "tx")
call assert_equal('testfile', getline(1))
" Pressing <Tab> after '%' completes the current file, also on MS-Windows
call feedkeys(":e %\t\r", "tx")
call assert_equal('e Xtestfile', @:)
endfunc
func Test_complete_list()
***************
*** 42,48 ****
" Test for displaying the tail of the completion matches
set wildmode=longest,full
! call mkdir('Xtest')
call writefile([], 'Xtest/a.c')
call writefile([], 'Xtest/a.h')
let g:Sline = ''
--- 41,47 ----
" Test for displaying the tail of the completion matches
set wildmode=longest,full
! call mkdir('Xtest', 'R')
call writefile([], 'Xtest/a.c')
call writefile([], 'Xtest/a.h')
let g:Sline = ''
***************
*** 78,89 ****
call assert_equal(':e Xtes[/', g:Sline)
call assert_equal('"e Xtes[/', @:)
- call delete('Xtest', 'rf')
set wildmode&
endfunc
func Test_complete_wildmenu()
! call mkdir('Xwilddir1/Xdir2', 'p')
call writefile(['testfile1'], 'Xwilddir1/Xtestfile1')
call writefile(['testfile2'], 'Xwilddir1/Xtestfile2')
call writefile(['testfile3'], 'Xwilddir1/Xdir2/Xtestfile3')
--- 77,87 ----
call assert_equal(':e Xtes[/', g:Sline)
call assert_equal('"e Xtes[/', @:)
set wildmode&
endfunc
func Test_complete_wildmenu()
! call mkdir('Xwilddir1/Xdir2', 'pR')
call writefile(['testfile1'], 'Xwilddir1/Xtestfile1')
call writefile(['testfile2'], 'Xwilddir1/Xtestfile2')
call writefile(['testfile3'], 'Xwilddir1/Xdir2/Xtestfile3')
***************
*** 162,168 ****
" cleanup
%bwipe
- call delete('Xwilddir1', 'rf')
set nowildmenu
endfunc
--- 160,165 ----
***************
*** 172,178 ****
let lines =<< trim [SCRIPT]
set wildmenu hlsearch
[SCRIPT]
! call writefile(lines, 'XTest_wildmenu')
let buf = RunVimInTerminal('-S XTest_wildmenu', {'rows': 8})
call term_sendkeys(buf, ":vim\<Tab>")
--- 169,175 ----
let lines =<< trim [SCRIPT]
set wildmenu hlsearch
[SCRIPT]
! call writefile(lines, 'XTest_wildmenu', 'D')
let buf = RunVimInTerminal('-S XTest_wildmenu', {'rows': 8})
call term_sendkeys(buf, ":vim\<Tab>")
***************
*** 190,196 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_wildmenu')
endfunc
func Test_redraw_in_autocmd()
--- 187,192 ----
***************
*** 200,206 ****
set cmdheight=2
autocmd CmdlineChanged * redraw
END
! call writefile(lines, 'XTest_redraw')
let buf = RunVimInTerminal('-S XTest_redraw', {'rows': 8})
call term_sendkeys(buf, ":for i in range(3)\<CR>")
--- 196,202 ----
set cmdheight=2
autocmd CmdlineChanged * redraw
END
! call writefile(lines, 'XTest_redraw', 'D')
let buf = RunVimInTerminal('-S XTest_redraw', {'rows': 8})
call term_sendkeys(buf, ":for i in range(3)\<CR>")
***************
*** 212,218 ****
" clean up
call term_sendkeys(buf, "\<CR>")
call StopVimInTerminal(buf)
- call delete('XTest_redraw')
endfunc
func Test_changing_cmdheight()
--- 208,213 ----
***************
*** 221,227 ****
let lines =<< trim END
set cmdheight=1 laststatus=2
END
! call writefile(lines, 'XTest_cmdheight')
let buf = RunVimInTerminal('-S XTest_cmdheight', {'rows': 8})
call term_sendkeys(buf, ":resize -3\<CR>")
--- 216,222 ----
let lines =<< trim END
set cmdheight=1 laststatus=2
END
! call writefile(lines, 'XTest_cmdheight', 'D')
let buf = RunVimInTerminal('-S XTest_cmdheight', {'rows': 8})
call term_sendkeys(buf, ":resize -3\<CR>")
***************
*** 246,252 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_cmdheight')
endfunc
func Test_map_completion()
--- 241,246 ----
***************
*** 455,464 ****
call assert_true(index(l, 'runtest.vim') < 0)
set wildignore&
" Directory name with space character
! call mkdir('Xdir with space')
call assert_equal(['Xdir with space/'], getcompletion('Xdir\ w', 'shellcmd'))
call assert_equal(['./Xdir with space/'], getcompletion('./Xdir', 'shellcmd'))
- call delete('Xdir with space', 'd')
let l = getcompletion('ha', 'filetype')
call assert_true(index(l, 'hamster') >= 0)
--- 449,457 ----
call assert_true(index(l, 'runtest.vim') < 0)
set wildignore&
" Directory name with space character
! call mkdir('Xdir with space', 'D')
call assert_equal(['Xdir with space/'], getcompletion('Xdir\ w', 'shellcmd'))
call assert_equal(['./Xdir with space/'], getcompletion('./Xdir', 'shellcmd'))
let l = getcompletion('ha', 'filetype')
call assert_true(index(l, 'hamster') >= 0)
***************
*** 581,594 ****
endif
set tags=Xtags
! call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags')
for name in names
let matchcount = len(getcompletion('', name))
call assert_true(matchcount >= 0, 'No matches for ' . name)
endfor
- call delete('Xtags')
set tags&
edit a~b
--- 574,586 ----
endif
set tags=Xtags
! call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags', 'D')
for name in names
let matchcount = len(getcompletion('', name))
call assert_true(matchcount >= 0, 'No matches for ' . name)
endfor
set tags&
edit a~b
***************
*** 633,639 ****
enddef
echo this will cause an error
END
! call mkdir('Xdir/autoload', 'p')
call writefile(lines, 'Xdir/autoload/script.vim')
exe 'set rtp+=' .. getcwd() .. '/Xdir'
--- 625,631 ----
enddef
echo this will cause an error
END
! call mkdir('Xdir/autoload', 'pR')
call writefile(lines, 'Xdir/autoload/script.vim')
exe 'set rtp+=' .. getcwd() .. '/Xdir'
***************
*** 647,653 ****
call v9.CheckScriptFailure(lines, 'E121: Undefined variable: this')
let &rtp = save_rtp
- call delete('Xdir', 'rf')
endfunc
func Test_fullcommand()
--- 639,644 ----
***************
*** 698,704 ****
func Test_shellcmd_completion()
let save_path = $PATH
! call mkdir('Xpathdir/Xpathsubdir', 'p')
call writefile([''], 'Xpathdir/Xfile.exe')
call setfperm('Xpathdir/Xfile.exe', 'rwx------')
--- 689,695 ----
func Test_shellcmd_completion()
let save_path = $PATH
! call mkdir('Xpathdir/Xpathsubdir', 'pR')
call writefile([''], 'Xpathdir/Xfile.exe')
call setfperm('Xpathdir/Xfile.exe', 'rwx------')
***************
*** 714,730 ****
call insert(expected, 'Xfile.exe')
call assert_equal(expected, actual)
- call delete('Xpathdir', 'rf')
let $PATH = save_path
endfunc
func Test_expand_star_star()
! call mkdir('a/b', 'p')
call writefile(['asdfasdf'], 'a/b/fileXname')
call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt')
call assert_equal('find a/b/fileXname', @:)
bwipe!
- call delete('a', 'rf')
endfunc
func Test_cmdline_paste()
--- 705,719 ----
call insert(expected, 'Xfile.exe')
call assert_equal(expected, actual)
let $PATH = save_path
endfunc
func Test_expand_star_star()
! call mkdir('a/b', 'pR')
call writefile(['asdfasdf'], 'a/b/fileXname')
call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt')
call assert_equal('find a/b/fileXname', @:)
bwipe!
endfunc
func Test_cmdline_paste()
***************
*** 832,845 ****
endfunc
func Test_illegal_address2()
! call writefile(['c', 'x', ' x', '.', '1;y'], 'Xtest.vim')
new
source Xtest.vim
" Trigger calling validate_cursor()
diffsp Xtest.vim
quit!
bwipe!
- call delete('Xtest.vim')
endfunc
func Test_mark_from_line_zero()
--- 821,833 ----
endfunc
func Test_illegal_address2()
! call writefile(['c', 'x', ' x', '.', '1;y'], 'Xtest.vim', 'D')
new
source Xtest.vim
" Trigger calling validate_cursor()
diffsp Xtest.vim
quit!
bwipe!
endfunc
func Test_mark_from_line_zero()
***************
*** 1035,1048 ****
call assert_equal("\"sI \<C-A>", @:)
" completion for :write command
! call mkdir('Xcwdir')
call writefile(['one'], 'Xcwdir/Xfile1')
let save_cwd = getcwd()
cd Xcwdir
call feedkeys(":w >> \<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"w >> Xfile1", @:)
call chdir(save_cwd)
- call delete('Xcwdir', 'rf')
" completion for :w ! and :r ! commands
call feedkeys(":w !invalid_xyz_cmd\<C-A>\<C-B>\"\<CR>", 'xt')
--- 1023,1035 ----
call assert_equal("\"sI \<C-A>", @:)
" completion for :write command
! call mkdir('Xcwdir', 'R')
call writefile(['one'], 'Xcwdir/Xfile1')
let save_cwd = getcwd()
cd Xcwdir
call feedkeys(":w >> \<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"w >> Xfile1", @:)
call chdir(save_cwd)
" completion for :w ! and :r ! commands
call feedkeys(":w !invalid_xyz_cmd\<C-A>\<C-B>\"\<CR>", 'xt')
***************
*** 1125,1136 ****
call assert_equal("\"doautocmd BufNew,BufEnter", @:)
" completion of file name in :doautocmd
! call writefile([], 'Xvarfile1')
! call writefile([], 'Xvarfile2')
call feedkeys(":doautocmd BufEnter Xvarfi\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"doautocmd BufEnter Xvarfile1 Xvarfile2", @:)
- call delete('Xvarfile1')
- call delete('Xvarfile2')
" completion for the :augroup command
augroup XTest.test
--- 1112,1121 ----
call assert_equal("\"doautocmd BufNew,BufEnter", @:)
" completion of file name in :doautocmd
! call writefile([], 'Xvarfile1', 'D')
! call writefile([], 'Xvarfile2', 'D')
call feedkeys(":doautocmd BufEnter Xvarfi\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"doautocmd BufEnter Xvarfile1 Xvarfile2", @:)
" completion for the :augroup command
augroup XTest.test
***************
*** 1272,1278 ****
" Test for 'wildignorecase'
func Test_cmdline_wildignorecase()
CheckUnix
! call writefile([], 'XTEST')
set wildignorecase
call feedkeys(":e xt\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e XTEST', @:)
--- 1257,1263 ----
" Test for 'wildignorecase'
func Test_cmdline_wildignorecase()
CheckUnix
! call writefile([], 'XTEST', 'D')
set wildignorecase
call feedkeys(":e xt\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e XTEST', @:)
***************
*** 1282,1288 ****
call assert_equal('"e xt', @:)
call assert_equal('XTEST', g:Sline)
set wildignorecase&
- call delete('XTEST')
endfunc
func Test_cmdline_write_alternatefile()
--- 1267,1272 ----
***************
*** 1408,1416 ****
let log = readfile('Xlog')
call assert_match("foo\nbar", join(log, "\n"))
call delete('Xlog')
! call mkdir('Xdir')
call assert_fails('set verbosefile=Xdir', ['E484:.*Xdir', 'E474:'])
- call delete('Xdir', 'd')
endfunc
func Test_verbose_option()
--- 1392,1400 ----
let log = readfile('Xlog')
call assert_match("foo\nbar", join(log, "\n"))
call delete('Xlog')
!
! call mkdir('Xdir', 'D')
call assert_fails('set verbosefile=Xdir', ['E484:.*Xdir', 'E474:'])
endfunc
func Test_verbose_option()
***************
*** 1421,1427 ****
call feedkeys("\r", 't') " for the hit-enter prompt
set verbose=20
[SCRIPT]
! call writefile(lines, 'XTest_verbose')
let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12})
call TermWait(buf, 50)
--- 1405,1411 ----
call feedkeys("\r", 't') " for the hit-enter prompt
set verbose=20
[SCRIPT]
! call writefile(lines, 'XTest_verbose', 'D')
let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12})
call TermWait(buf, 50)
***************
*** 1430,1436 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_verbose')
endfunc
func Test_setcmdpos()
--- 1414,1419 ----
***************
*** 1533,1539 ****
call setline(1, range(30))
[SCRIPT]
! call writefile(lines, 'XtestCmdlineClearTabenter')
let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10})
call TermWait(buf, 25)
" in one tab make the command line higher with CTRL-W -
--- 1516,1522 ----
call setline(1, range(30))
[SCRIPT]
! call writefile(lines, 'XtestCmdlineClearTabenter', 'D')
let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10})
call TermWait(buf, 25)
" in one tab make the command line higher with CTRL-W -
***************
*** 1541,1547 ****
call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {})
call StopVimInTerminal(buf)
- call delete('XtestCmdlineClearTabenter')
endfunc
" Test for expanding special keywords in cmdline
--- 1524,1529 ----
***************
*** 1552,1565 ****
call assert_fails('e <abuf>', 'E496:')
call assert_fails('e <amatch>', 'E497:')
! call writefile([], 'Xfile.cpp')
! call writefile([], 'Xfile.java')
new Xfile.cpp
call feedkeys(":e %:r\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e Xfile.cpp Xfile.java', @:)
close
- call delete('Xfile.cpp')
- call delete('Xfile.java')
endfunc
" Test for backtick expression in the command line
--- 1534,1545 ----
call assert_fails('e <abuf>', 'E496:')
call assert_fails('e <amatch>', 'E497:')
! call writefile([], 'Xfile.cpp', 'D')
! call writefile([], 'Xfile.java', 'D')
new Xfile.cpp
call feedkeys(":e %:r\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e Xfile.cpp Xfile.java', @:)
close
endfunc
" Test for backtick expression in the command line
***************
*** 1593,1603 ****
call delete('Xfile.out')
qall!
[SCRIPT]
! call writefile(lines, 'Xscript')
if RunVim([], [], '--clean -S Xscript')
call assert_equal([], readfile('Xresult'))
endif
- call delete('Xscript')
call delete('Xresult')
endfunc
--- 1573,1582 ----
call delete('Xfile.out')
qall!
[SCRIPT]
! call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '--clean -S Xscript')
call assert_equal([], readfile('Xresult'))
endif
call delete('Xresult')
endfunc
***************
*** 1619,1625 ****
" Test for using ~ for home directory in cmdline completion matches
func Test_cmdline_expand_home()
! call mkdir('Xexpdir')
call writefile([], 'Xexpdir/Xfile1')
call writefile([], 'Xexpdir/Xfile2')
cd Xexpdir
--- 1598,1604 ----
" Test for using ~ for home directory in cmdline completion matches
func Test_cmdline_expand_home()
! call mkdir('Xexpdir', 'R')
call writefile([], 'Xexpdir/Xfile1')
call writefile([], 'Xexpdir/Xfile2')
cd Xexpdir
***************
*** 1629,1635 ****
call assert_equal('"e ~/Xfile1 ~/Xfile2', @:)
let $HOME = save_HOME
cd ..
- call delete('Xexpdir', 'rf')
endfunc
" Test for using CTRL-\ CTRL-G in the command line to go back to normal mode
--- 1608,1613 ----
***************
*** 1714,1721 ****
" Test for longest file name completion with 'fileignorecase'
" On MS-Windows, file names are case insensitive.
if has('unix')
! call writefile([], 'XTESTfoo')
! call writefile([], 'Xtestbar')
set nofileignorecase
call feedkeys(":e XT\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e XTESTfoo', @:)
--- 1692,1699 ----
" Test for longest file name completion with 'fileignorecase'
" On MS-Windows, file names are case insensitive.
if has('unix')
! call writefile([], 'XTESTfoo', 'D')
! call writefile([], 'Xtestbar', 'D')
set nofileignorecase
call feedkeys(":e XT\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e XTESTfoo', @:)
***************
*** 1727,1734 ****
call feedkeys(":e Xt\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e Xtest', @:)
set fileignorecase&
- call delete('XTESTfoo')
- call delete('Xtestbar')
endif
%argdelete
--- 1705,1710 ----
***************
*** 1750,1756 ****
endfunc
func Test_custom_complete_autoload()
! call mkdir('Xcustdir/autoload', 'p')
let save_rtp = &rtp
exe 'set rtp=' .. getcwd() .. '/Xcustdir'
let lines =<< trim END
--- 1726,1732 ----
endfunc
func Test_custom_complete_autoload()
! call mkdir('Xcustdir/autoload', 'pR')
let save_rtp = &rtp
exe 'set rtp=' .. getcwd() .. '/Xcustdir'
let lines =<< trim END
***************
*** 1769,1775 ****
let &rtp = save_rtp
set wildmode& wildmenu&
delcommand MyCmd
- call delete('Xcustdir', 'rf')
endfunc
" Test for interrupting the command-line completion
--- 1745,1750 ----
***************
*** 1946,1952 ****
func Test_wildmenu_dirstack()
CheckUnix
%bw!
! call mkdir('Xwildmenu/dir2/dir3/dir4', 'p')
call writefile([], 'Xwildmenu/file1_1.txt')
call writefile([], 'Xwildmenu/file1_2.txt')
call writefile([], 'Xwildmenu/dir2/file2_1.txt')
--- 1921,1927 ----
func Test_wildmenu_dirstack()
CheckUnix
%bw!
! call mkdir('Xwildmenu/dir2/dir3/dir4', 'pR')
call writefile([], 'Xwildmenu/file1_1.txt')
call writefile([], 'Xwildmenu/file1_2.txt')
call writefile([], 'Xwildmenu/dir2/file2_1.txt')
***************
*** 1974,1980 ****
call feedkeys(":e Xwildmenu/\<Tab>\<Down>\<Down>\<Down>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e Xwildmenu/dir2/dir3/dir4/file4_1.txt', @:)
- call delete('Xwildmenu', 'rf')
set wildmenu&
endfunc
--- 1949,1954 ----
***************
*** 2054,2062 ****
" Test for the 'suffixes' option
func Test_suffixes_opt()
! call writefile([], 'Xsuffile')
! call writefile([], 'Xsuffile.c')
! call writefile([], 'Xsuffile.o')
set suffixes=
call feedkeys(":e Xsuffi*\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e Xsuffile Xsuffile.c Xsuffile.o', @:)
--- 2028,2036 ----
" Test for the 'suffixes' option
func Test_suffixes_opt()
! call writefile([], 'Xsuffile', 'D')
! call writefile([], 'Xsuffile.c', 'D')
! call writefile([], 'Xsuffile.o', 'D')
set suffixes=
call feedkeys(":e Xsuffi*\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e Xsuffile Xsuffile.c Xsuffile.o', @:)
***************
*** 2076,2084 ****
" Test for getcompletion() with different patterns
call assert_equal(['Xsuffile', 'Xsuffile.c', 'Xsuffile.o'], getcompletion('Xsuffile', 'file'))
call assert_equal(['Xsuffile'], getcompletion('Xsuffile$', 'file'))
- call delete('Xsuffile')
- call delete('Xsuffile.c')
- call delete('Xsuffile.o')
endfunc
" Test for using a popup menu for the command line completion matches
--- 2050,2055 ----
***************
*** 2120,2126 ****
call feedkeys(":edit $VIMRUNTIME/\<Tab>\<Left>\<C-U>ab\<Tab>")
endfunc
[CODE]
! call writefile(commands, 'Xtest')
let buf = RunVimInTerminal('-S Xtest', #{rows: 10})
--- 2091,2097 ----
call feedkeys(":edit $VIMRUNTIME/\<Tab>\<Left>\<C-U>ab\<Tab>")
endfunc
[CODE]
! call writefile(commands, 'Xtest', 'D')
let buf = RunVimInTerminal('-S Xtest', #{rows: 10})
***************
*** 2258,2264 ****
call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {})
" Tests a directory name contained full-width characters.
! call mkdir('Xnamedir/あいう', 'p')
call writefile([], 'Xnamedir/あいう/abc')
call writefile([], 'Xnamedir/あいう/xyz')
call writefile([], 'Xnamedir/あいう/123')
--- 2229,2235 ----
call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {})
" Tests a directory name contained full-width characters.
! call mkdir('Xnamedir/あいう', 'pR')
call writefile([], 'Xnamedir/あいう/abc')
call writefile([], 'Xnamedir/あいう/xyz')
call writefile([], 'Xnamedir/あいう/123')
***************
*** 2346,2353 ****
call term_sendkeys(buf, "\<C-U>\<CR>")
call StopVimInTerminal(buf)
- call delete('Xtest')
- call delete('Xnamedir', 'rf')
endfunc
" Test for wildmenumode() with the cmdline popup menu
--- 2317,2322 ----
***************
*** 2378,2384 ****
set foldtext=MyFoldText() wildoptions=pum
normal ggzfj
END
! call writefile(lines, 'Xpumfold')
let buf = RunVimInTerminal('-S Xpumfold', #{rows: 10})
call term_sendkeys(buf, ":set\<Tab>")
call VerifyScreenDump(buf, 'Test_wildmenu_with_pum_foldexpr_1', {})
--- 2347,2353 ----
set foldtext=MyFoldText() wildoptions=pum
normal ggzfj
END
! call writefile(lines, 'Xpumfold', 'D')
let buf = RunVimInTerminal('-S Xpumfold', #{rows: 10})
call term_sendkeys(buf, ":set\<Tab>")
call VerifyScreenDump(buf, 'Test_wildmenu_with_pum_foldexpr_1', {})
***************
*** 2387,2393 ****
call VerifyScreenDump(buf, 'Test_wildmenu_with_pum_foldexpr_2', {})
call StopVimInTerminal(buf)
- call delete('Xpumfold')
endfunc
" Test for opening the cmdline completion popup menu from the terminal window.
--- 2356,2361 ----
***************
*** 2402,2408 ****
let cmds = ['set wildmenu wildoptions=pum']
let pcmd = python .. ' -c "import sys; sys.stdout.write(sys.stdin.read())"'
call add(cmds, "call term_start('" .. pcmd .. "')")
! call writefile(cmds, 'Xtest')
let buf = RunVimInTerminal('-S Xtest', #{rows: 10})
call term_sendkeys(buf, "\r\r\r")
call term_wait(buf)
--- 2370,2376 ----
let cmds = ['set wildmenu wildoptions=pum']
let pcmd = python .. ' -c "import sys; sys.stdout.write(sys.stdin.read())"'
call add(cmds, "call term_start('" .. pcmd .. "')")
! call writefile(cmds, 'Xtest', 'D')
let buf = RunVimInTerminal('-S Xtest', #{rows: 10})
call term_sendkeys(buf, "\r\r\r")
call term_wait(buf)
***************
*** 2411,2417 ****
call VerifyScreenDump(buf, 'Test_wildmenu_pum_term_01', {})
call term_wait(buf)
call StopVimInTerminal(buf)
- call delete('Xtest')
endfunc
" Test for completion after a :substitute command followed by a pipe (|)
--- 2379,2384 ----
***************
*** 2511,2517 ****
func Test_fuzzy_completion_bufname_fullpath()
CheckUnix
set wildoptions&
! call mkdir('Xcmd/Xstate/Xfile.js', 'p')
edit Xcmd/Xstate/Xfile.js
cd Xcmd/Xstate
enew
--- 2478,2484 ----
func Test_fuzzy_completion_bufname_fullpath()
CheckUnix
set wildoptions&
! call mkdir('Xcmd/Xstate/Xfile.js', 'pR')
edit Xcmd/Xstate/Xfile.js
cd Xcmd/Xstate
enew
***************
*** 2521,2527 ****
call feedkeys(":b CmdStateFile\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_match('Xcmd/Xstate/Xfile.js$', @:)
cd -
- call delete('Xcmd', 'rf')
set wildoptions&
endfunc
--- 2488,2493 ----
***************
*** 3028,3034 ****
call assert_equal([], l)
" Test for :breakadd file [lnum] <file>
! call writefile([], 'Xscript')
call feedkeys(":breakadd file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal("\"breakadd file Xscript", @:)
call feedkeys(":breakadd file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
--- 2994,3000 ----
call assert_equal([], l)
" Test for :breakadd file [lnum] <file>
! call writefile([], 'Xscript', 'D')
call feedkeys(":breakadd file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal("\"breakadd file Xscript", @:)
call feedkeys(":breakadd file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
***************
*** 3047,3053 ****
call assert_equal("\"breakadd file Xscript ", @:)
call feedkeys(":breakadd file X1B2C3\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal("\"breakadd file X1B2C3", @:)
- call delete('Xscript')
" Test for :breakadd func [lnum] <function>
func Xbreak_func()
--- 3013,3018 ----
***************
*** 3109,3115 ****
call assert_equal("\"breakdel abc", @:)
" Test for :breakdel file [lnum] <file>
! call writefile([], 'Xscript')
call feedkeys(":breakdel file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal("\"breakdel file Xscript", @:)
call feedkeys(":breakdel file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
--- 3074,3080 ----
call assert_equal("\"breakdel abc", @:)
" Test for :breakdel file [lnum] <file>
! call writefile([], 'Xscript', 'D')
call feedkeys(":breakdel file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal("\"breakdel file Xscript", @:)
call feedkeys(":breakdel file Xsc\<Tab>\<C-B>\"\<CR>", 'tx')
***************
*** 3128,3134 ****
call assert_equal("\"breakdel file Xscript ", @:)
call feedkeys(":breakdel file X1B2C3\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal("\"breakdel file X1B2C3", @:)
- call delete('Xscript')
" Test for :breakdel func [lnum] <function>
func Xbreak_func()
--- 3093,3098 ----
***************
*** 3165,3171 ****
" Test for :scriptnames argument completion
func Test_cmdline_complete_scriptnames()
set wildmenu
! call writefile(['let a = 1'], 'Xa1b2c3.vim')
source Xa1b2c3.vim
call feedkeys(":script \<Tab>\<Left>\<Left>\<C-B>\"\<CR>", 'tx')
call assert_match("\"script .*Xa1b2c3.vim$", @:)
--- 3129,3135 ----
" Test for :scriptnames argument completion
func Test_cmdline_complete_scriptnames()
set wildmenu
! call writefile(['let a = 1'], 'Xa1b2c3.vim', 'D')
source Xa1b2c3.vim
call feedkeys(":script \<Tab>\<Left>\<Left>\<C-B>\"\<CR>", 'tx')
call assert_match("\"script .*Xa1b2c3.vim$", @:)
***************
*** 3185,3191 ****
call feedkeys(":script \<Tab>\<Left>\<Left>\<CR>", 'tx')
call assert_equal('Xa1b2c3.vim', fnamemodify(@%, ':t'))
bw!
- call delete('Xa1b2c3.vim')
set wildmenu&
endfunc
--- 3149,3154 ----
***************
*** 3259,3271 ****
set showtabline=2
autocmd CmdlineEnter * set tabline=foo
END
! call writefile(lines, 'Xcmdline_redraw_tabline')
let buf = RunVimInTerminal('-S Xcmdline_redraw_tabline', #{rows: 6})
call term_sendkeys(buf, ':')
call WaitForAssert({-> assert_match('^foo', term_getline(buf, 1))})
call StopVimInTerminal(buf)
- call delete('Xcmdline_redraw_tabline')
endfunc
func Test_wildmenu_pum_disable_while_shown()
--- 3222,3233 ----
set showtabline=2
autocmd CmdlineEnter * set tabline=foo
END
! call writefile(lines, 'Xcmdline_redraw_tabline', 'D')
let buf = RunVimInTerminal('-S Xcmdline_redraw_tabline', #{rows: 6})
call term_sendkeys(buf, ':')
call WaitForAssert({-> assert_match('^foo', term_getline(buf, 1))})
call StopVimInTerminal(buf)
endfunc
func Test_wildmenu_pum_disable_while_shown()
*** ../vim-9.0.0417/src/testdir/test_cmdwin.vim 2022-08-23 19:54:24.251779395 +0100
--- src/testdir/test_cmdwin.vim 2022-09-08 16:26:21.537352829 +0100
***************
*** 70,76 ****
call setline(1, range(30))
2split
[SCRIPT]
! call writefile(lines, 'XTest_restore')
let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
call TermWait(buf, 50)
--- 70,76 ----
call setline(1, range(30))
2split
[SCRIPT]
! call writefile(lines, 'XTest_restore', 'D')
let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
call TermWait(buf, 50)
***************
*** 90,96 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_restore')
endfunc
func Test_cmdwin_no_terminal()
--- 90,95 ----
***************
*** 186,192 ****
let lines =<< trim [SCRIPT]
au WinNew * smile
[SCRIPT]
! call writefile(lines, 'XTest_cmdwin')
let buf = RunVimInTerminal('-S XTest_cmdwin', {'rows': 18})
" open cmdwin
--- 185,191 ----
let lines =<< trim [SCRIPT]
au WinNew * smile
[SCRIPT]
! call writefile(lines, 'XTest_cmdwin', 'D')
let buf = RunVimInTerminal('-S XTest_cmdwin', {'rows': 18})
" open cmdwin
***************
*** 201,207 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_cmdwin')
endfunc
" Test for recursively getting multiple command line inputs
--- 200,205 ----
*** ../vim-9.0.0417/src/testdir/test_conceal.vim 2022-07-09 04:56:12.522528981 +0100
--- src/testdir/test_conceal.vim 2022-09-08 16:27:42.405331850 +0100
***************
*** 25,31 ****
exe "normal /here\r"
[CODE]
! call writefile(code, 'XTest_conceal')
" Check that cursor line is concealed
let buf = RunVimInTerminal('-S XTest_conceal', {})
call VerifyScreenDump(buf, 'Test_conceal_two_windows_01', {})
--- 25,31 ----
exe "normal /here\r"
[CODE]
! call writefile(code, 'XTest_conceal', 'D')
" Check that cursor line is concealed
let buf = RunVimInTerminal('-S XTest_conceal', {})
call VerifyScreenDump(buf, 'Test_conceal_two_windows_01', {})
***************
*** 109,115 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_conceal')
endfunc
func Test_conceal_with_cursorline()
--- 109,114 ----
***************
*** 126,132 ****
normal M
[CODE]
! call writefile(code, 'XTest_conceal_cul')
let buf = RunVimInTerminal('-S XTest_conceal_cul', {})
call VerifyScreenDump(buf, 'Test_conceal_cul_01', {})
--- 125,131 ----
normal M
[CODE]
! call writefile(code, 'XTest_conceal_cul', 'D')
let buf = RunVimInTerminal('-S XTest_conceal_cul', {})
call VerifyScreenDump(buf, 'Test_conceal_cul_01', {})
***************
*** 138,144 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_conceal_cul')
endfunc
func Test_conceal_resize_term()
--- 137,142 ----
***************
*** 150,156 ****
syn region CommentCodeSpan matchgroup=Comment start=/`/ end=/`/ concealends
normal fb
[CODE]
! call writefile(code, 'XTest_conceal_resize')
let buf = RunVimInTerminal('-S XTest_conceal_resize', {'rows': 6})
call VerifyScreenDump(buf, 'Test_conceal_resize_01', {})
--- 148,154 ----
syn region CommentCodeSpan matchgroup=Comment start=/`/ end=/`/ concealends
normal fb
[CODE]
! call writefile(code, 'XTest_conceal_resize', 'D')
let buf = RunVimInTerminal('-S XTest_conceal_resize', {'rows': 6})
call VerifyScreenDump(buf, 'Test_conceal_resize_01', {})
***************
*** 159,165 ****
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_conceal_resize')
endfunc
" Tests for correct display (cursor column position) with +conceal and
--- 157,162 ----
***************
*** 247,253 ****
:q!
[CODE]
! call writefile(code, 'XTest_conceal_curpos')
if RunVim([], [], '-s XTest_conceal_curpos')
call assert_equal([
--- 244,250 ----
:q!
[CODE]
! call writefile(code, 'XTest_conceal_curpos', 'D')
if RunVim([], [], '-s XTest_conceal_curpos')
call assert_equal([
***************
*** 258,264 ****
endif
call delete('Xconceal_curpos.out')
- call delete('XTest_conceal_curpos')
endfunc
func Test_conceal_eol()
--- 255,260 ----
*** ../vim-9.0.0417/src/testdir/test_cpoptions.vim 2022-08-30 21:46:03.657214444 +0100
--- src/testdir/test_cpoptions.vim 2022-09-08 16:29:22.701301635 +0100
***************
*** 8,14 ****
" file name.
func Test_cpo_a()
let save_cpo = &cpo
! call writefile(['one'], 'XfileCpoA')
" Wipe out all the buffers, so that the alternate file is empty
edit Xfoo | %bw
set cpo-=a
--- 8,14 ----
" file name.
func Test_cpo_a()
let save_cpo = &cpo
! call writefile(['one'], 'XfileCpoA', 'D')
" Wipe out all the buffers, so that the alternate file is empty
edit Xfoo | %bw
set cpo-=a
***************
*** 20,26 ****
read XfileCpoA
call assert_equal('XfileCpoA', @#)
close!
- call delete('XfileCpoA')
let &cpo = save_cpo
endfunc
--- 20,25 ----
***************
*** 99,119 ****
" Test for the 'C' flag in 'cpo' (line continuation)
func Test_cpo_C()
let save_cpo = &cpo
! call writefile(['let l = [', '\ 1,', '\ 2]'], 'XfileCpoC')
set cpo-=C
source XfileCpoC
call assert_equal([1, 2], g:l)
set cpo+=C
call assert_fails('source XfileCpoC', ['E697:', 'E10:'])
- call delete('XfileCpoC')
let &cpo = save_cpo
endfunc
" Test for the 'd' flag in 'cpo' (tags relative to the current file)
func Test_cpo_d()
let save_cpo = &cpo
! call mkdir('XdirCpoD')
! call writefile(["one\tXfile1\t/^one$/"], 'tags')
call writefile(["two\tXfile2\t/^two$/"], 'XdirCpoD/tags')
set tags=./tags
set cpo-=d
--- 98,117 ----
" Test for the 'C' flag in 'cpo' (line continuation)
func Test_cpo_C()
let save_cpo = &cpo
! call writefile(['let l = [', '\ 1,', '\ 2]'], 'XfileCpoC', 'D')
set cpo-=C
source XfileCpoC
call assert_equal([1, 2], g:l)
set cpo+=C
call assert_fails('source XfileCpoC', ['E697:', 'E10:'])
let &cpo = save_cpo
endfunc
" Test for the 'd' flag in 'cpo' (tags relative to the current file)
func Test_cpo_d()
let save_cpo = &cpo
! call mkdir('XdirCpoD', 'R')
! call writefile(["one\tXfile1\t/^one$/"], 'tags', 'D')
call writefile(["two\tXfile2\t/^two$/"], 'XdirCpoD/tags')
set tags=./tags
set cpo-=d
***************
*** 121,129 ****
call assert_equal('two', taglist('.*')[0].name)
set cpo+=d
call assert_equal('one', taglist('.*')[0].name)
%bw!
- call delete('tags')
- call delete('XdirCpoD', 'rf')
set tags&
let &cpo = save_cpo
endfunc
--- 119,126 ----
call assert_equal('two', taglist('.*')[0].name)
set cpo+=d
call assert_equal('one', taglist('.*')[0].name)
+
%bw!
set tags&
let &cpo = save_cpo
endfunc
***************
*** 415,428 ****
let save_cpo = &cpo
new XfileCpoO
call setline(1, 'one')
! call writefile(['two'], 'XfileCpoO')
set cpo-=O
call assert_fails('write', 'E13:')
set cpo+=O
write
call assert_equal(['one'], readfile('XfileCpoO'))
close!
- call delete('XfileCpoO')
let &cpo = save_cpo
endfunc
--- 412,424 ----
let save_cpo = &cpo
new XfileCpoO
call setline(1, 'one')
! call writefile(['two'], 'XfileCpoO', 'D')
set cpo-=O
call assert_fails('write', 'E13:')
set cpo+=O
write
call assert_equal(['one'], readfile('XfileCpoO'))
close!
let &cpo = save_cpo
endfunc
***************
*** 432,438 ****
" name)
func Test_cpo_P()
let save_cpo = &cpo
! call writefile([], 'XfileCpoP')
new
call setline(1, 'one')
set cpo+=F
--- 428,434 ----
" name)
func Test_cpo_P()
let save_cpo = &cpo
! call writefile([], 'XfileCpoP', 'D')
new
call setline(1, 'one')
set cpo+=F
***************
*** 443,449 ****
write >> XfileCpoP
call assert_equal('XfileCpoP', @%)
close!
- call delete('XfileCpoP')
let &cpo = save_cpo
endfunc
--- 439,444 ----
***************
*** 635,641 ****
" Test for the 'Z' flag in 'cpo' (write! resets 'readonly')
func Test_cpo_Z()
let save_cpo = &cpo
! call writefile([], 'XfileCpoZ')
new XfileCpoZ
setlocal readonly
set cpo-=Z
--- 630,636 ----
" Test for the 'Z' flag in 'cpo' (write! resets 'readonly')
func Test_cpo_Z()
let save_cpo = &cpo
! call writefile([], 'XfileCpoZ', 'D')
new XfileCpoZ
setlocal readonly
set cpo-=Z
***************
*** 646,652 ****
write!
call assert_equal(1, &readonly)
close!
- call delete('XfileCpoZ')
let &cpo = save_cpo
endfunc
--- 641,646 ----
***************
*** 723,729 ****
" flag)
func Test_cpo_plus()
let save_cpo = &cpo
! call writefile([], 'XfileCpoPlus')
new XfileCpoPlus
call setline(1, 'foo')
write X1
--- 717,723 ----
" flag)
func Test_cpo_plus()
let save_cpo = &cpo
! call writefile([], 'XfileCpoPlus', 'D')
new XfileCpoPlus
call setline(1, 'foo')
write X1
***************
*** 732,738 ****
write X2
call assert_equal(0, &modified)
close!
- call delete('XfileCpoPlus')
call delete('X1')
call delete('X2')
let &cpo = save_cpo
--- 726,731 ----
***************
*** 835,841 ****
" Test for the '&' flag in 'cpo'. The swap file is kept when a buffer is still
" loaded and ':preserve' is used.
func Test_cpo_ampersand()
! call writefile(['one'], 'XfileCpoAmp')
let after =<< trim [CODE]
set cpo+=&
preserve
--- 828,834 ----
" Test for the '&' flag in 'cpo'. The swap file is kept when a buffer is still
" loaded and ':preserve' is used.
func Test_cpo_ampersand()
! call writefile(['one'], 'XfileCpoAmp', 'D')
let after =<< trim [CODE]
set cpo+=&
preserve
***************
*** 845,851 ****
call assert_equal(1, filereadable('.XfileCpoAmp.swp'))
call delete('.XfileCpoAmp.swp')
endif
- call delete('XfileCpoAmp')
endfunc
" Test for the '\' flag in 'cpo' (backslash in a [] range in a search pattern)
--- 838,843 ----
*** ../vim-9.0.0417/src/testdir/test_cscope.vim 2022-06-21 16:53:03.000000000 +0100
--- src/testdir/test_cscope.vim 2022-09-08 16:36:27.720623563 +0100
***************
*** 300,306 ****
" Test ":cs add {dir}" (add the {dir}/cscope.out database)
func Test_cscope_add_dir()
! call mkdir('Xcscopedir', 'p')
" Cscope doesn't handle symlinks, so this needs to be resolved in case a
" shadow directory is being used.
--- 300,306 ----
" Test ":cs add {dir}" (add the {dir}/cscope.out database)
func Test_cscope_add_dir()
! call mkdir('Xcscopedir', 'pD')
" Cscope doesn't handle symlinks, so this needs to be resolved in case a
" shadow directory is being used.
***************
*** 318,325 ****
cs kill -1
call delete('Xcscopedir/cscope.out')
call assert_fails('cs add Xcscopedir', 'E563:')
-
- call delete('Xcscopedir', 'd')
endfunc
func Test_cscopequickfix()
--- 318,323 ----
*** ../vim-9.0.0417/src/testdir/test_cursorline.vim 2022-04-20 22:30:41.000000000 +0100
--- src/testdir/test_cursorline.vim 2022-09-08 16:31:25.409259565 +0100
***************
*** 133,139 ****
call extend(lines, lines1)
call extend(lines, ["call append(0, ".. string(file_content).. ')'])
call extend(lines, lines2)
! call writefile(lines, filename)
" basic test
let buf = RunVimInTerminal('-S '. filename, #{rows: 20})
call VerifyScreenDump(buf, 'Test_'. filename. '_1', {})
--- 133,139 ----
call extend(lines, lines1)
call extend(lines, ["call append(0, ".. string(file_content).. ')'])
call extend(lines, lines2)
! call writefile(lines, filename, 'D')
" basic test
let buf = RunVimInTerminal('-S '. filename, #{rows: 20})
call VerifyScreenDump(buf, 'Test_'. filename. '_1', {})
***************
*** 196,202 ****
call term_sendkeys(buf, ":set list& cursorlineopt& listchars&\<cr>")
call StopVimInTerminal(buf)
- call delete(filename)
endfunc
func Test_cursorline_redraw()
--- 196,201 ----
***************
*** 227,239 ****
When the option was set by hand there is no "Last set" message.
When the option was set while executing a function, user command or
END
! call writefile(textlines, 'Xtextfile')
let script =<< trim END
set cursorline scrolloff=2
normal 12G
END
! call writefile(script, 'Xscript')
let buf = RunVimInTerminal('-S Xscript Xtextfile', #{rows: 20, cols: 40})
call VerifyScreenDump(buf, 'Test_cursorline_redraw_1', {})
--- 226,238 ----
When the option was set by hand there is no "Last set" message.
When the option was set while executing a function, user command or
END
! call writefile(textlines, 'Xtextfile', 'D')
let script =<< trim END
set cursorline scrolloff=2
normal 12G
END
! call writefile(script, 'Xscript', 'D')
let buf = RunVimInTerminal('-S Xscript Xtextfile', #{rows: 20, cols: 40})
call VerifyScreenDump(buf, 'Test_cursorline_redraw_1', {})
***************
*** 243,250 ****
call VerifyScreenDump(buf, 'Test_cursorline_redraw_2', {})
call StopVimInTerminal(buf)
- call delete('Xscript')
- call delete('Xtextfile')
endfunc
func Test_cursorline_callback()
--- 242,247 ----
***************
*** 262,275 ****
call timer_start(300, 'Func')
END
! call writefile(lines, 'Xcul_timer')
let buf = RunVimInTerminal('-S Xcul_timer', #{rows: 8})
call TermWait(buf, 310)
call VerifyScreenDump(buf, 'Test_cursorline_callback_1', {})
call StopVimInTerminal(buf)
- call delete('Xcul_timer')
endfunc
func Test_cursorline_screenline_update()
--- 259,271 ----
call timer_start(300, 'Func')
END
! call writefile(lines, 'Xcul_timer', 'D')
let buf = RunVimInTerminal('-S Xcul_timer', #{rows: 8})
call TermWait(buf, 310)
call VerifyScreenDump(buf, 'Test_cursorline_callback_1', {})
call StopVimInTerminal(buf)
endfunc
func Test_cursorline_screenline_update()
***************
*** 280,286 ****
set cursorline cursorlineopt=screenline
inoremap <F2> <Cmd>call cursor(1, 1)<CR>
END
! call writefile(lines, 'Xcul_screenline')
let buf = RunVimInTerminal('-S Xcul_screenline', #{rows: 8})
call term_sendkeys(buf, "A")
--- 276,282 ----
set cursorline cursorlineopt=screenline
inoremap <F2> <Cmd>call cursor(1, 1)<CR>
END
! call writefile(lines, 'Xcul_screenline', 'D')
let buf = RunVimInTerminal('-S Xcul_screenline', #{rows: 8})
call term_sendkeys(buf, "A")
***************
*** 290,296 ****
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
- call delete('Xcul_screenline')
endfunc
func Test_cursorline_cursorbind_horizontal_scroll()
--- 286,291 ----
***************
*** 307,313 ****
20vsp
windo :set cursorbind
END
! call writefile(lines, 'Xhor_scroll')
let buf = RunVimInTerminal('-S Xhor_scroll', #{rows: 8})
call term_sendkeys(buf, "20l")
--- 302,308 ----
20vsp
windo :set cursorbind
END
! call writefile(lines, 'Xhor_scroll', 'D')
let buf = RunVimInTerminal('-S Xhor_scroll', #{rows: 8})
call term_sendkeys(buf, "20l")
***************
*** 326,332 ****
call VerifyScreenDump(buf, 'Test_hor_scroll_5', {})
call StopVimInTerminal(buf)
- call delete('Xhor_scroll')
endfunc
--- 321,326 ----
*** ../vim-9.0.0417/src/version.c 2022-09-08 14:41:45.338817579 +0100
--- src/version.c 2022-09-08 16:36:48.368558499 +0100
***************
*** 705,706 ****
--- 705,708 ----
{ /* Add new patch number below this line */
+ /**/
+ 418,
/**/
--
`The Guide says there is an art to flying,' said Ford, `or at least a
knack. The knack lies in learning how to throw yourself at the ground
and miss.' He smiled weakly.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"