From b18b49699776485150b71626069a40d12d2c5590 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 2 Sep 2022 21:55:50 +0100 Subject: patch 9.0.0363: common names in test files causes tests to be flaky Problem: Common names in test files causes tests to be flaky. Solution: Use more specific names. --- src/testdir/test_autocmd.vim | 2 +- src/testdir/test_eval_stuff.vim | 6 +- src/testdir/test_excmd.vim | 44 ++-- src/testdir/test_expand.vim | 28 +-- src/testdir/test_file_perm.vim | 6 +- src/testdir/test_filechanged.vim | 8 +- src/testdir/test_fileformat.vim | 16 +- src/testdir/test_filetype.vim | 14 +- src/testdir/test_fold.vim | 12 +- src/testdir/test_functions.vim | 28 +-- src/testdir/test_gf.vim | 22 +- src/testdir/test_gui.vim | 6 +- src/testdir/test_indent.vim | 6 +- src/testdir/test_ins_complete.vim | 6 +- src/testdir/test_mksession.vim | 6 +- src/testdir/test_modeline.vim | 6 +- src/testdir/test_normal.vim | 24 +- src/testdir/test_options.vim | 2 +- src/testdir/test_plus_arg_edit.vim | 14 +- src/testdir/test_popupwin.vim | 4 +- src/testdir/test_python2.vim | 50 ++--- src/testdir/test_python3.vim | 50 ++--- src/testdir/test_source.vim | 10 +- src/testdir/test_stat.vim | 2 +- src/testdir/test_substitute.vim | 4 +- src/testdir/test_tabpage.vim | 6 +- src/testdir/test_tagjump.vim | 156 ++++++------- src/testdir/test_terminal.vim | 22 +- src/testdir/test_terminal2.vim | 8 +- src/testdir/test_vim9_assign.vim | 2 +- src/testdir/test_vim9_cmd.vim | 26 +-- src/testdir/test_vim9_import.vim | 12 +- src/testdir/test_vim9_script.vim | 32 +-- src/testdir/test_visual.vim | 2 +- src/testdir/test_window_cmd.vim | 42 ++-- src/testdir/test_writefile.vim | 444 ++++++++++++++++++------------------- src/version.c | 2 + 37 files changed, 566 insertions(+), 564 deletions(-) (limited to 'src') diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 737dd0bd05..0072e3d0d8 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -3062,7 +3062,7 @@ func Test_BufDelete_changebuf() augroup END let save_cpo = &cpo set cpo+=f - call assert_fails('r Xfile', ['E812:', 'E484:']) + call assert_fails('r Xchangebuf', ['E812:', 'E484:']) call assert_equal('somefile', @%) let &cpo = save_cpo augroup TestAuCmd diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim index 934286bbe8..3669cfd40b 100644 --- a/src/testdir/test_eval_stuff.vim +++ b/src/testdir/test_eval_stuff.vim @@ -35,9 +35,9 @@ func Test_mkdir_p() call assert_report('mkdir(..., "p") failed for an existing directory') endtry " 'p' doesn't suppress real errors - call writefile([], 'Xfile') - call assert_fails('call mkdir("Xfile", "p")', 'E739:') - call delete('Xfile') + call writefile([], 'Xmkdirfile') + call assert_fails('call mkdir("Xmkdirfile", "p")', 'E739:') + call delete('Xmkdirfile') call delete('Xmkdir', 'rf') call assert_equal(0, mkdir(test_null_string())) call assert_fails('call mkdir([])', 'E730:') diff --git a/src/testdir/test_excmd.vim b/src/testdir/test_excmd.vim index 52d41db601..a56676ef5a 100644 --- a/src/testdir/test_excmd.vim +++ b/src/testdir/test_excmd.vim @@ -83,23 +83,23 @@ endfunc " Test for the :drop command func Test_drop_cmd() - call writefile(['L1', 'L2'], 'Xfile') + call writefile(['L1', 'L2'], 'Xdropfile') enew | only - drop Xfile + drop Xdropfile call assert_equal('L2', getline(2)) " Test for switching to an existing window below new - drop Xfile + drop Xdropfile call assert_equal(1, winnr()) " Test for splitting the current window enew | only set modified - drop Xfile + drop Xdropfile call assert_equal(2, winnr('$')) " Check for setting the argument list - call assert_equal(['Xfile'], argv()) + call assert_equal(['Xdropfile'], argv()) enew | only! - call delete('Xfile') + call delete('Xdropfile') endfunc " Test for the :append command @@ -509,10 +509,10 @@ func Test_redir_cmd_readonly() CheckNotRoot " Redirecting to a read-only file - call writefile([], 'Xfile') - call setfperm('Xfile', 'r--r--r--') - call assert_fails('redir! > Xfile', 'E190:') - call delete('Xfile') + call writefile([], 'Xredirfile') + call setfperm('Xredirfile', 'r--r--r--') + call assert_fails('redir! > Xredirfile', 'E190:') + call delete('Xredirfile') endfunc " Test for the :filetype command @@ -532,21 +532,21 @@ endfunc " Test for the :read command func Test_read_cmd() - call writefile(['one'], 'Xfile') + call writefile(['one'], 'Xcmdfile') new call assert_fails('read', 'E32:') - edit Xfile + edit Xcmdfile read call assert_equal(['one', 'one'], getline(1, '$')) close! new - read Xfile + read Xcmdfile call assert_equal(['', 'one'], getline(1, '$')) call deletebufline('', 1, '$') - call feedkeys("Qr Xfile\visual\", 'xt') + call feedkeys("Qr Xcmdfile\visual\", 'xt') call assert_equal(['one'], getline(1, '$')) close! - call delete('Xfile') + call delete('Xcmdfile') endfunc " Test for running Ex commands when text is locked. @@ -633,9 +633,9 @@ func Sandbox_tests() endif call assert_fails("let $TESTVAR=1", 'E48:') call assert_fails("call feedkeys('ivim')", 'E48:') - call assert_fails("source! Xfile", 'E48:') - call assert_fails("call delete('Xfile')", 'E48:') - call assert_fails("call writefile([], 'Xfile')", 'E48:') + call assert_fails("source! Xsomefile", 'E48:') + call assert_fails("call delete('Xthatfile')", 'E48:') + call assert_fails("call writefile([], 'Xanotherfile')", 'E48:') call assert_fails('!ls', 'E48:') call assert_fails('shell', 'E48:') call assert_fails('stop', 'E48:') @@ -660,7 +660,7 @@ func Sandbox_tests() if has('terminal') call assert_fails('terminal', 'E48:') call assert_fails('call term_start("vim")', 'E48:') - call assert_fails('call term_dumpwrite(1, "Xfile")', 'E48:') + call assert_fails('call term_dumpwrite(1, "Xdumpfile")', 'E48:') endif if has('channel') call assert_fails("call ch_logfile('chlog')", 'E48:') @@ -727,17 +727,17 @@ endfunc " Test :write after changing name with :file and loading it with :edit func Test_write_after_rename() - call writefile(['text'], 'Xfile') + call writefile(['text'], 'Xafterfile') enew - file Xfile + file Xafterfile call assert_fails('write', 'E13: File exists (add ! to override)') " works OK after ":edit" edit write - call delete('Xfile') + call delete('Xafterfile') bwipe! endfunc diff --git a/src/testdir/test_expand.vim b/src/testdir/test_expand.vim index cd537f4ea1..8f2fab69ea 100644 --- a/src/testdir/test_expand.vim +++ b/src/testdir/test_expand.vim @@ -57,26 +57,26 @@ func Test_expandcmd() unlet $FOO new - edit Xfile1 - call assert_equal('e Xfile1', expandcmd('e %')) - edit Xfile2 - edit Xfile1 - call assert_equal('e Xfile2', 'e #'->expandcmd()) - edit Xfile2 - edit Xfile3 - edit Xfile4 - let bnum = bufnr('Xfile2') - call assert_equal('e Xfile2', expandcmd('e #' . bnum)) + edit Xpandfile1 + call assert_equal('e Xpandfile1', expandcmd('e %')) + edit Xpandfile2 + edit Xpandfile1 + call assert_equal('e Xpandfile2', 'e #'->expandcmd()) + edit Xpandfile2 + edit Xpandfile3 + edit Xpandfile4 + let bnum = bufnr('Xpandfile2') + call assert_equal('e Xpandfile2', expandcmd('e #' . bnum)) call setline('.', 'Vim!@#') call assert_equal('e Vim', expandcmd('e ')) call assert_equal('e Vim!@#', expandcmd('e ')) enew! - edit Xfile.java - call assert_equal('e Xfile.py', expandcmd('e %:r.py')) + edit Xpandfile.java + call assert_equal('e Xpandfile.py', expandcmd('e %:r.py')) call assert_equal('make abc.java', expandcmd('make abc.%:e')) - call assert_equal('make Xabc.java', expandcmd('make %:s?file?abc?')) + call assert_equal('make Xabc.java', expandcmd('make %:s?pandfile?abc?')) edit a1a2a3.rb - call assert_equal('make b1b2b3.rb a1a2a3 Xfile.o', expandcmd('make %:gs?a?b? %< #<.o')) + call assert_equal('make b1b2b3.rb a1a2a3 Xpandfile.o', expandcmd('make %:gs?a?b? %< #<.o')) call assert_equal('make ', expandcmd("make ")) call assert_equal('make ', expandcmd("make ")) diff --git a/src/testdir/test_file_perm.vim b/src/testdir/test_file_perm.vim index 1cb09e8647..bb6573bab6 100644 --- a/src/testdir/test_file_perm.vim +++ b/src/testdir/test_file_perm.vim @@ -22,9 +22,9 @@ func Test_file_perm() call assert_equal(1, setfperm('Xtest', 'rwx------')) call delete('Xtest') - call assert_fails("call setfperm(['Xfile'], 'rw-rw-rw-')", 'E730:') - call assert_fails("call setfperm('Xfile', [])", 'E730:') - call assert_fails("call setfperm('Xfile', 'rwxrwxrwxrw')", 'E475:') + call assert_fails("call setfperm(['Xpermfile'], 'rw-rw-rw-')", 'E730:') + call assert_fails("call setfperm('Xpermfile', [])", 'E730:') + call assert_fails("call setfperm('Xpermfile', 'rwxrwxrwxrw')", 'E475:') endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_filechanged.vim b/src/testdir/test_filechanged.vim index 5dca43fd4e..5a9a400752 100644 --- a/src/testdir/test_filechanged.vim +++ b/src/testdir/test_filechanged.vim @@ -253,15 +253,15 @@ endfunc " Test for editing a new buffer from a FileChangedShell autocmd func Test_FileChangedShell_newbuf() - call writefile(['one', 'two'], 'Xfile') - new Xfile + call writefile(['one', 'two'], 'Xchfile') + new Xchfile augroup testnewbuf autocmd FileChangedShell * enew augroup END - call writefile(['red'], 'Xfile') + call writefile(['red'], 'Xchfile') call assert_fails('checktime', 'E811:') au! testnewbuf - call delete('Xfile') + call delete('Xchfile') endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_fileformat.vim b/src/testdir/test_fileformat.vim index 6ba6e49ada..1c66e882c8 100644 --- a/src/testdir/test_fileformat.vim +++ b/src/testdir/test_fileformat.vim @@ -22,16 +22,16 @@ endfunc func Test_fileformat_autocommand() let filecnt = ["", "foobar\", "eins\", "\", "zwei\", "drei", "vier", "fünf", ""] let ffs = &ffs - call writefile(filecnt, 'Xfile', 'b') - au BufReadPre Xfile set ffs=dos ff=dos - new Xfile + call writefile(filecnt, 'Xffafile', 'b') + au BufReadPre Xffafile set ffs=dos ff=dos + new Xffafile call assert_equal('dos', &l:ff) call assert_equal('dos', &ffs) " cleanup - call delete('Xfile') + call delete('Xffafile') let &ffs = ffs - au! BufReadPre Xfile + au! BufReadPre Xffafile bw! endfunc @@ -314,14 +314,14 @@ endfunc " used as the 'fileformat'. func Test_fileformat_on_startup() let after =<< trim END - call writefile([&fileformat], 'Xfile', 'a') + call writefile([&fileformat], 'Xonsfile', 'a') quit END call RunVim(["set ffs=dos,unix,mac"], after, '') call RunVim(["set ffs=mac,dos,unix"], after, '') call RunVim(["set ffs=unix,mac,dos"], after, '') - call assert_equal(['dos', 'mac', 'unix'], readfile('Xfile')) - call delete('Xfile') + call assert_equal(['dos', 'mac', 'unix'], readfile('Xonsfile')) + call delete('Xonsfile') endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index fbb8d2d2dd..551602fbe1 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -14,15 +14,15 @@ endfunc func Test_conf_type() filetype on - call writefile(['# some comment', 'must be conf'], 'Xfile') + call writefile(['# some comment', 'must be conf'], 'Xconffile') augroup filetypedetect au BufNewFile,BufRead * call assert_equal(0, did_filetype()) augroup END - split Xfile + split Xconffile call assert_equal('conf', &filetype) bwipe! - call delete('Xfile') + call delete('Xconffile') filetype off endfunc @@ -30,15 +30,15 @@ func Test_other_type() filetype on augroup filetypedetect au BufNewFile,BufRead * call assert_equal(0, did_filetype()) - au BufNewFile,BufRead Xfile setf testfile + au BufNewFile,BufRead Xotherfile setf testfile au BufNewFile,BufRead * call assert_equal(1, did_filetype()) augroup END - call writefile(['# some comment', 'must be conf'], 'Xfile') - split Xfile + call writefile(['# some comment', 'must be conf'], 'Xotherfile') + split Xotherfile call assert_equal('testfile', &filetype) bwipe! - call delete('Xfile') + call delete('Xotherfile') filetype off endfunc diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim index 2618084025..33303da1b2 100644 --- a/src/testdir/test_fold.vim +++ b/src/testdir/test_fold.vim @@ -137,9 +137,9 @@ func Test_indent_fold_with_read() call assert_equal(1, foldlevel(n)) endfor - call writefile(["a", "", "\a"], 'Xfile') + call writefile(["a", "", "\a"], 'Xinfofile') foldopen - 2read Xfile + 2read Xinfofile %foldclose call assert_equal(1, foldlevel(1)) call assert_equal(2, foldclosedend(1)) @@ -150,7 +150,7 @@ func Test_indent_fold_with_read() bwipe! set foldmethod& - call delete('Xfile') + call delete('Xinfofile') endfunc func Test_combining_folds_indent() @@ -216,8 +216,8 @@ func Test_update_folds_expr_read() set foldexpr=s:TestFoldExpr(v:lnum) 2 foldopen - call writefile(['b', 'b', 'a', 'a', 'd', 'a', 'a', 'c'], 'Xfile') - read Xfile + call writefile(['b', 'b', 'a', 'a', 'd', 'a', 'a', 'c'], 'Xupfofile') + read Xupfofile %foldclose call assert_equal(2, foldclosedend(1)) call assert_equal(0, foldlevel(3)) @@ -226,7 +226,7 @@ func Test_update_folds_expr_read() call assert_equal(10, foldclosedend(7)) call assert_equal(14, foldclosedend(11)) - call delete('Xfile') + call delete('Xupfofile') bwipe! set foldmethod& foldexpr& endfunc diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index e05268a746..cad1d4b435 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -375,22 +375,22 @@ func Test_resolve_win32() " test for shortcut file if executable('cscript') - new Xfile + new Xresfile wq let lines =<< trim END Set fs = CreateObject("Scripting.FileSystemObject") Set ws = WScript.CreateObject("WScript.Shell") Set shortcut = ws.CreateShortcut("Xlink.lnk") - shortcut.TargetPath = fs.BuildPath(ws.CurrentDirectory, "Xfile") + shortcut.TargetPath = fs.BuildPath(ws.CurrentDirectory, "Xresfile") shortcut.Save END call writefile(lines, 'link.vbs') silent !cscript link.vbs call delete('link.vbs') - call assert_equal(s:normalize_fname(getcwd() . '\Xfile'), s:normalize_fname(resolve('./Xlink.lnk'))) - call delete('Xfile') + call assert_equal(s:normalize_fname(getcwd() . '\Xresfile'), s:normalize_fname(resolve('./Xlink.lnk'))) + call delete('Xresfile') - call assert_equal(s:normalize_fname(getcwd() . '\Xfile'), s:normalize_fname(resolve('./Xlink.lnk'))) + call assert_equal(s:normalize_fname(getcwd() . '\Xresfile'), s:normalize_fname(resolve('./Xlink.lnk'))) call delete('Xlink.lnk') else echomsg 'skipped test for shortcut file' @@ -399,20 +399,20 @@ func Test_resolve_win32() " remove files call delete('Xlink') call delete('Xdir', 'd') - call delete('Xfile') + call delete('Xresfile') " test for symbolic link to a file - new Xfile + new Xresfile wq - call assert_equal('Xfile', resolve('Xfile')) - silent !mklink Xlink Xfile + call assert_equal('Xresfile', resolve('Xresfile')) + silent !mklink Xlink Xresfile if !v:shell_error - call assert_equal(s:normalize_fname(getcwd() . '\Xfile'), s:normalize_fname(resolve('./Xlink'))) + call assert_equal(s:normalize_fname(getcwd() . '\Xresfile'), s:normalize_fname(resolve('./Xlink'))) call delete('Xlink') else echomsg 'skipped test for symbolic link to a file' endif - call delete('Xfile') + call delete('Xresfile') " test for junction to a directory call mkdir('Xdir') @@ -447,9 +447,9 @@ func Test_resolve_win32() endif " test for buffer name - new Xfile + new Xbuffile wq - silent !mklink Xlink Xfile + silent !mklink Xlink Xbuffile if !v:shell_error edit Xlink call assert_equal('Xlink', bufname('%')) @@ -458,7 +458,7 @@ func Test_resolve_win32() else echomsg 'skipped test for buffer name' endif - call delete('Xfile') + call delete('Xbuffile') " test for reparse point call mkdir('Xdir') diff --git a/src/testdir/test_gf.vim b/src/testdir/test_gf.vim index 04228b2c13..53571d8add 100644 --- a/src/testdir/test_gf.vim +++ b/src/testdir/test_gf.vim @@ -49,38 +49,38 @@ endfunc func Test_gF() new call setline(1, ['111', '222', '333', '444']) - w! Xfile + w! Xgffile close new set isfname-=: - call setline(1, ['one', 'Xfile:3', 'three']) + call setline(1, ['one', 'Xgffile:3', 'three']) 2 call assert_fails('normal gF', 'E37:') call assert_equal(2, getcurpos()[1]) - w! Xfile2 + w! Xgffile2 normal gF - call assert_equal('Xfile', bufname('%')) + call assert_equal('Xgffile', bufname('%')) call assert_equal(3, getcurpos()[1]) enew! - call setline(1, ['one', 'the Xfile line 2, and more', 'three']) - w! Xfile2 + call setline(1, ['one', 'the Xgffile line 2, and more', 'three']) + w! Xgffile2 normal 2GfX normal gF - call assert_equal('Xfile', bufname('%')) + call assert_equal('Xgffile', bufname('%')) call assert_equal(2, getcurpos()[1]) " jumping to the file/line with CTRL-W_F %bw! edit Xfile1 - call setline(1, ['one', 'Xfile:4', 'three']) + call setline(1, ['one', 'Xgffile:4', 'three']) exe "normal 2G\F" - call assert_equal('Xfile', bufname('%')) + call assert_equal('Xgffile', bufname('%')) call assert_equal(4, getcurpos()[1]) set isfname& - call delete('Xfile') - call delete('Xfile2') + call delete('Xgffile') + call delete('Xgffile2') %bw! endfunc diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index fcb54e5aed..29e4ecdd5b 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -1602,7 +1602,7 @@ endfunc func Test_gui_dialog_file() let lines =<< trim END - file Xfile + file Xdialfile normal axxx confirm qa END @@ -1614,10 +1614,10 @@ func Test_gui_dialog_file() execute prefix .. GetVimCommand() .. ' -g -f --clean --gui-dialog-file Xdialog -S Xlines' call WaitForAssert({-> assert_true(filereadable('Xdialog'))}) - call assert_match('Question: Save changes to "Xfile"?', readfile('Xdialog')->join('')) + call assert_match('Question: Save changes to "Xdialfile"?', readfile('Xdialog')->join('')) call delete('Xdialog') - call delete('Xfile') + call delete('Xdialfile') call delete('Xlines') endfunc diff --git a/src/testdir/test_indent.vim b/src/testdir/test_indent.vim index 3b5b643177..97c44b8bb5 100644 --- a/src/testdir/test_indent.vim +++ b/src/testdir/test_indent.vim @@ -161,9 +161,9 @@ func Test_modeline_indent_expr() func GetIndent() return line('.') * 2 endfunc - call writefile(['# vim: indentexpr=GetIndent()'], 'Xfile.txt') + call writefile(['# vim: indentexpr=GetIndent()'], 'Xmlfile.txt') set modelineexpr - new Xfile.txt + new Xmlfile.txt call assert_equal('GetIndent()', &indentexpr) exe "normal Oa\nb\n" call assert_equal([' a', ' b'], getline(1, 2)) @@ -172,7 +172,7 @@ func Test_modeline_indent_expr() delfunc GetIndent let &modeline = modeline close! - call delete('Xfile.txt') + call delete('Xmlfile.txt') endfunc func Test_indent_func_with_gq() diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index cee6a329f7..a79a7867fe 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -1226,14 +1226,14 @@ func Test_complete_unreadable_thesaurus_file() CheckUnix CheckNotRoot - call writefile(['about', 'above'], 'Xfile') - call setfperm('Xfile', '---r--r--') + call writefile(['about', 'above'], 'Xunrfile') + call setfperm('Xunrfile', '---r--r--') new set complete=sXfile exe "normal! ia\" call assert_equal('a', getline(1)) bw! - call delete('Xfile') + call delete('Xunrfile') set complete& endfunc diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index c916b1a517..92cf8bfa5d 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -1235,8 +1235,8 @@ endfunc " Test for creating views with manual folds func Test_mkview_manual_fold() - call writefile(range(1,10), 'Xfile') - new Xfile + call writefile(range(1,10), 'Xmkvfile') + new Xmkvfile " create recursive folds 5,6fold 4,7fold @@ -1259,7 +1259,7 @@ func Test_mkview_manual_fold() source Xview call assert_equal([-1, -1, -1, -1, -1, -1], [foldclosed(3), foldclosed(4), \ foldclosed(5), foldclosed(6), foldclosed(7), foldclosed(8)]) - call delete('Xfile') + call delete('Xmkvfile') call delete('Xview') bw! endfunc diff --git a/src/testdir/test_modeline.vim b/src/testdir/test_modeline.vim index f28ad3e84f..fc0779b5f5 100644 --- a/src/testdir/test_modeline.vim +++ b/src/testdir/test_modeline.vim @@ -350,13 +350,13 @@ endfunc " Some options cannot be set from the modeline when 'diff' option is set func Test_modeline_diff_buffer() - call writefile(['vim: diff foldmethod=marker wrap'], 'Xfile') + call writefile(['vim: diff foldmethod=marker wrap'], 'Xmdifile') set foldmethod& nowrap - new Xfile + new Xmdifile call assert_equal('manual', &foldmethod) call assert_false(&wrap) set wrap& - call delete('Xfile') + call delete('Xmdifile') bw endfunc diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 86f0ef656b..352c609481 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1709,14 +1709,14 @@ endfunc func Test_normal20_exmode() " Reading from redirected file doesn't work on MS-Windows CheckNotMSWindows - call writefile(['1a', 'foo', 'bar', '.', 'w! Xfile2', 'q!'], 'Xscript') - call writefile(['1', '2'], 'Xfile') - call system(GetVimCommand() .. ' -e -s < Xscript Xfile') - let a=readfile('Xfile2') + call writefile(['1a', 'foo', 'bar', '.', 'w! Xn20file2', 'q!'], 'Xn20script') + call writefile(['1', '2'], 'Xn20file') + call system(GetVimCommand() .. ' -e -s < Xn20script Xn20file') + let a=readfile('Xn20file2') call assert_equal(['1', 'foo', 'bar', '2'], a) " clean up - for file in ['Xfile', 'Xfile2', 'Xscript'] + for file in ['Xn20file', 'Xn20file2', 'Xn20script'] call delete(file) endfor bw! @@ -1758,22 +1758,22 @@ func Test_normal22_zet() " Test for ZZ " let shell = &shell " let &shell = 'sh' - call writefile(['1', '2'], 'Xfile') + call writefile(['1', '2'], 'Xn22file') let args = ' -N -i NONE --noplugins -X --not-a-term' - call system(GetVimCommand() .. args .. ' -c "%d" -c ":norm! ZZ" Xfile') - let a = readfile('Xfile') + call system(GetVimCommand() .. args .. ' -c "%d" -c ":norm! ZZ" Xn22file') + let a = readfile('Xn22file') call assert_equal([], a) " Test for ZQ - call writefile(['1', '2'], 'Xfile') - call system(GetVimCommand() . args . ' -c "%d" -c ":norm! ZQ" Xfile') - let a = readfile('Xfile') + call writefile(['1', '2'], 'Xn22file') + call system(GetVimCommand() . args . ' -c "%d" -c ":norm! ZQ" Xn22file') + let a = readfile('Xn22file') call assert_equal(['1', '2'], a) " Unsupported Z command call assert_beeps('normal! ZW') " clean up - for file in ['Xfile'] + for file in ['Xn22file'] call delete(file) endfor " let &shell = shell diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 56629d91bd..ec114942a7 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -883,7 +883,7 @@ func Test_write() new call setline(1, ['L1']) set nowrite - call assert_fails('write Xfile', 'E142:') + call assert_fails('write Xwrfile', 'E142:') set write close! endfunc diff --git a/src/testdir/test_plus_arg_edit.vim b/src/testdir/test_plus_arg_edit.vim index e9019c1181..7213b20584 100644 --- a/src/testdir/test_plus_arg_edit.vim +++ b/src/testdir/test_plus_arg_edit.vim @@ -12,26 +12,26 @@ endfunction func Test_edit_bad() " Test loading a utf8 file with bad utf8 sequences. - call writefile(["[\xff][\xc0][\xe2\x89\xf0][\xc2\xc2]"], "Xfile") + call writefile(["[\xff][\xc0][\xe2\x89\xf0][\xc2\xc2]"], "Xbadfile") new " Without ++bad=..., the default behavior is like ++bad=? - e! ++enc=utf8 Xfile + e! ++enc=utf8 Xbadfile call assert_equal('[?][?][???][??]', getline(1)) - e! ++encoding=utf8 ++bad=_ Xfile + e! ++encoding=utf8 ++bad=_ Xbadfile call assert_equal('[_][_][___][__]', getline(1)) - e! ++enc=utf8 ++bad=drop Xfile + e! ++enc=utf8 ++bad=drop Xbadfile call assert_equal('[][][][]', getline(1)) - e! ++enc=utf8 ++bad=keep Xfile + e! ++enc=utf8 ++bad=keep Xbadfile call assert_equal("[\xff][\xc0][\xe2\x89\xf0][\xc2\xc2]", getline(1)) - call assert_fails('e! ++enc=utf8 ++bad=foo Xfile', 'E474:') + call assert_fails('e! ++enc=utf8 ++bad=foo Xbadfile', 'E474:') bw! - call delete('Xfile') + call delete('Xbadfile') endfunc " Test for ++bin and ++nobin arguments diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index a92bd8b032..7cdd12865f 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -4104,7 +4104,7 @@ endfunc func Test_popup_setoptions_other_tab() - new Xfile + new Xpotfile let winid = win_getid() call setline(1, 'some text') call prop_type_add('textprop', {}) @@ -4116,7 +4116,7 @@ func Test_popup_setoptions_other_tab() tabclose call popup_close(id) - bwipe! Xfile + bwipe! Xpotfile call prop_type_delete('textprop') endfunc diff --git a/src/testdir/test_python2.vim b/src/testdir/test_python2.vim index 3fc3c204c5..af1e340fae 100644 --- a/src/testdir/test_python2.vim +++ b/src/testdir/test_python2.vim @@ -1565,11 +1565,11 @@ func Test_python_buffer() %bw! " Range object for a deleted buffer - new Xfile + new Xpbuffile call setline(1, ['one', 'two', 'three']) py b = vim.current.buffer py r = vim.current.buffer.range(0, 2) - call assert_equal('', pyeval('repr(r)')) + call assert_equal('', pyeval('repr(r)')) %bw! call AssertException(['py r[:] = []'], \ 'Vim(python):vim.error: attempt to refer to deleted buffer') @@ -1598,7 +1598,7 @@ endfunc " Test vim.buffers object func Test_python_buffers() %bw! - edit Xfile + edit Xpbuffile py cb = vim.current.buffer set hidden edit a @@ -1626,8 +1626,8 @@ func Test_python_buffers() cb.append('i3:' + str(next(i3))) del i3 EOF - call assert_equal(['i:', - \ 'i2:', 'i:', 'i3:'], + call assert_equal(['i:', + \ 'i2:', 'i:', 'i3:'], \ getline(2, '$')) %d @@ -1645,7 +1645,7 @@ func Test_python_buffers() cb.append(str(len(vim.buffers))) EOF - call assert_equal([bufnr('Xfile') .. ':=', + call assert_equal([bufnr('Xpbuffile') .. ':=', \ bufnr('a') .. ':=', \ bufnr('b') .. ':=', \ bufnr('c') .. ':=', '4'], getline(2, '$')) @@ -1675,15 +1675,15 @@ func Test_python_buffers() del i4 del bnums EOF - call assert_equal(['i4:', - \ 'i4:', 'StopIteration'], getline(2, '$')) + call assert_equal(['i4:', + \ 'i4:', 'StopIteration'], getline(2, '$')) %bw! endfunc " Test vim.{tabpage,window}list and vim.{tabpage,window} objects func Test_python_tabpage_window() %bw - edit Xfile + edit Xpbuffile py cb = vim.current.buffer tabnew 0 tabnew 1 @@ -1748,7 +1748,7 @@ func Test_python_tabpage_window() Current tab pages: (1): 1 windows, current is Windows: - (1): displays buffer ; cursor is at (2, 0) + (1): displays buffer ; cursor is at (2, 0) (2): 1 windows, current is Windows: (1): displays buffer ; cursor is at (1, 0) @@ -1764,14 +1764,14 @@ func Test_python_tabpage_window() (4): displays buffer ; cursor is at (1, 0) Number of windows in current tab page: 4 END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) + call assert_equal(expected, getbufline(bufnr('Xpbuffile'), 2, '$')) %bw! endfunc " Test vim.current func Test_python_vim_current() %bw - edit Xfile + edit Xpbuffile py cb = vim.current.buffer tabnew 0 tabnew 1 @@ -1797,8 +1797,8 @@ func Test_python_vim_current() Current window: : is Current buffer: : is is END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) - call deletebufline(bufnr('Xfile'), 1, '$') + call assert_equal(expected, getbufline(bufnr('Xpbuffile'), 2, '$')) + call deletebufline(bufnr('Xpbuffile'), 1, '$') " Assigning: fails py << trim EOF @@ -1821,10 +1821,10 @@ func Test_python_vim_current() Type error at assigning None to vim.current.tabpage Type error at assigning None to vim.current.buffer END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) - call deletebufline(bufnr('Xfile'), 1, '$') + call assert_equal(expected, getbufline(bufnr('Xpbuffile'), 2, '$')) + call deletebufline(bufnr('Xpbuffile'), 1, '$') - call setbufline(bufnr('Xfile'), 1, 'python interface') + call setbufline(bufnr('Xpbuffile'), 1, 'python interface') py << trim EOF # Assigning: success vim.current.tabpage = vim.tabpages[-2] @@ -1840,13 +1840,13 @@ func Test_python_vim_current() let expected =<< trim END Current tab page: Current window: - Current buffer: + Current buffer: Current line: 'python interface' END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) + call assert_equal(expected, getbufline(bufnr('Xpbuffile'), 2, '$')) py vim.current.line = 'one line' call assert_equal('one line', getline('.')) - call deletebufline(bufnr('Xfile'), 1, '$') + call deletebufline(bufnr('Xpbuffile'), 1, '$') py << trim EOF ws = list(vim.windows) @@ -1866,7 +1866,7 @@ func Test_python_vim_current() w.valid: [True, False] t.valid: [True, False, True, False] END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) + call assert_equal(expected, getbufline(bufnr('Xpbuffile'), 2, '$')) %bw! endfunc @@ -2409,7 +2409,7 @@ endfunc " Test chdir func Test_python_chdir() - new Xfile + new Xpycfile py cb = vim.current.buffer py << trim EOF import os @@ -2420,7 +2420,7 @@ func Test_python_chdir() path = fnamemodify('.', ':p:h:t') if path != 'src' and path != 'src2': # Running tests from a shadow directory, so move up another level - # This will result in @% looking like shadow/testdir/Xfile, hence the + # This will result in @% looking like shadow/testdir/Xpycfile, hence the # extra fnamemodify os.chdir('..') cb.append(fnamemodify('.', ':p:h:t')) @@ -2436,8 +2436,8 @@ func Test_python_chdir() cb.append(vim.eval('@%')) del fnamemodify EOF - call assert_equal(['testdir', 'Xfile', 'src', 'testdir/Xfile', 'testdir', - \ 'Xfile'], getline(2, '$')) + call assert_equal(['testdir', 'Xpycfile', 'src', 'testdir/Xpycfile', 'testdir', + \ 'Xpycfile'], getline(2, '$')) close! call AssertException(["py vim.chdir(None)"], "Vim(python):TypeError:") endfunc diff --git a/src/testdir/test_python3.vim b/src/testdir/test_python3.vim index 778d83b8e0..437da513b0 100644 --- a/src/testdir/test_python3.vim +++ b/src/testdir/test_python3.vim @@ -1762,11 +1762,11 @@ func Test_python3_buffer() %bw! " Range object for a deleted buffer - new Xfile + new Xp3buffile call setline(1, ['one', 'two', 'three']) py3 b = vim.current.buffer py3 r = vim.current.buffer.range(0, 2) - call assert_equal('', py3eval('repr(r)')) + call assert_equal('', py3eval('repr(r)')) %bw! call AssertException(['py3 r[:] = []'], \ 'Vim(py3):vim.error: attempt to refer to deleted buffer') @@ -1795,7 +1795,7 @@ endfunc " Test vim.buffers object func Test_python3_buffers() %bw! - edit Xfile + edit Xp3buffile py3 cb = vim.current.buffer set hidden edit a @@ -1819,8 +1819,8 @@ func Test_python3_buffers() cb.append('i3:' + str(next(i3))) del i3 EOF - call assert_equal(['i:', - \ 'i2:', 'i:', 'i3:'], + call assert_equal(['i:', + \ 'i2:', 'i:', 'i3:'], \ getline(2, '$')) %d @@ -1838,7 +1838,7 @@ func Test_python3_buffers() cb.append(str(len(vim.buffers))) EOF - call assert_equal([bufnr('Xfile') .. ':=', + call assert_equal([bufnr('Xp3buffile') .. ':=', \ bufnr('a') .. ':=', \ bufnr('b') .. ':=', \ bufnr('c') .. ':=', '4'], getline(2, '$')) @@ -1868,15 +1868,15 @@ func Test_python3_buffers() del i4 del bnums EOF - call assert_equal(['i4:', - \ 'i4:', 'StopIteration'], getline(2, '$')) + call assert_equal(['i4:', + \ 'i4:', 'StopIteration'], getline(2, '$')) %bw! endfunc " Test vim.{tabpage,window}list and vim.{tabpage,window} objects func Test_python3_tabpage_window() %bw - edit Xfile + edit Xp3buffile py3 cb = vim.current.buffer tabnew 0 tabnew 1 @@ -1937,7 +1937,7 @@ func Test_python3_tabpage_window() Current tab pages: (1): 1 windows, current is Windows: - (1): displays buffer ; cursor is at (2, 0) + (1): displays buffer ; cursor is at (2, 0) (2): 1 windows, current is Windows: (1): displays buffer ; cursor is at (1, 0) @@ -1953,14 +1953,14 @@ func Test_python3_tabpage_window() (4): displays buffer ; cursor is at (1, 0) Number of windows in current tab page: 4 END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) + call assert_equal(expected, getbufline(bufnr('Xp3buffile'), 2, '$')) %bw! endfunc " Test vim.current func Test_python3_vim_current() %bw - edit Xfile + edit Xpy3cfile py3 cb = vim.current.buffer tabnew 0 tabnew 1 @@ -1986,8 +1986,8 @@ func Test_python3_vim_current() Current window: : is Current buffer: : is is END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) - call deletebufline(bufnr('Xfile'), 1, '$') + call assert_equal(expected, getbufline(bufnr('Xpy3cfile'), 2, '$')) + call deletebufline(bufnr('Xpy3cfile'), 1, '$') " Assigning: fails py3 << trim EOF @@ -2010,10 +2010,10 @@ func Test_python3_vim_current() Type error at assigning None to vim.current.tabpage Type error at assigning None to vim.current.buffer END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) - call deletebufline(bufnr('Xfile'), 1, '$') + call assert_equal(expected, getbufline(bufnr('Xpy3cfile'), 2, '$')) + call deletebufline(bufnr('Xpy3cfile'), 1, '$') - call setbufline(bufnr('Xfile'), 1, 'python interface') + call setbufline(bufnr('Xpy3cfile'), 1, 'python interface') py3 << trim EOF # Assigning: success vim.current.tabpage = vim.tabpages[-2] @@ -2029,13 +2029,13 @@ func Test_python3_vim_current() let expected =<< trim END Current tab page: Current window: - Current buffer: + Current buffer: Current line: 'python interface' END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) + call assert_equal(expected, getbufline(bufnr('Xpy3cfile'), 2, '$')) py3 vim.current.line = 'one line' call assert_equal('one line', getline('.')) - call deletebufline(bufnr('Xfile'), 1, '$') + call deletebufline(bufnr('Xpy3cfile'), 1, '$') py3 << trim EOF ws = list(vim.windows) @@ -2055,7 +2055,7 @@ func Test_python3_vim_current() w.valid: [True, False] t.valid: [True, False, True, False] END - call assert_equal(expected, getbufline(bufnr('Xfile'), 2, '$')) + call assert_equal(expected, getbufline(bufnr('Xpy3cfile'), 2, '$')) %bw! endfunc @@ -2598,7 +2598,7 @@ endfunc " Test chdir func Test_python3_chdir() - new Xfile + new Xp3cdfile py3 cb = vim.current.buffer py3 << trim EOF import os @@ -2609,7 +2609,7 @@ func Test_python3_chdir() path = fnamemodify('.', ':p:h:t') if path != b'src' and path != b'src2': # Running tests from a shadow directory, so move up another level - # This will result in @% looking like shadow/testdir/Xfile, hence the + # This will result in @% looking like shadow/testdir/Xp3cdfile, hence the # slicing to remove the leading path and path separator os.chdir('..') cb.append(str(fnamemodify('.', ':p:h:t'))) @@ -2625,8 +2625,8 @@ func Test_python3_chdir() cb.append(vim.eval('@%')) del fnamemodify EOF - call assert_equal(["b'testdir'", 'Xfile', "b'src'", 'testdir/Xfile', - \"b'testdir'", 'Xfile'], getline(2, '$')) + call assert_equal(["b'testdir'", 'Xp3cdfile', "b'src'", 'testdir/Xp3cdfile', + \"b'testdir'", 'Xp3cdfile'], getline(2, '$')) close! call AssertException(["py3 vim.chdir(None)"], "Vim(py3):TypeError:") endfunc diff --git a/src/testdir/test_source.vim b/src/testdir/test_source.vim index 4736e93546..44cd2fdc72 100644 --- a/src/testdir/test_source.vim +++ b/src/testdir/test_source.vim @@ -63,10 +63,10 @@ endfunc " When sourcing a vim script, shebang should be ignored. func Test_source_ignore_shebang() - call writefile(['#!./xyzabc', 'let g:val=369'], 'Xfile.vim') - source Xfile.vim + call writefile(['#!./xyzabc', 'let g:val=369'], 'Xsisfile.vim') + source Xsisfile.vim call assert_equal(g:val, 369) - call delete('Xfile.vim') + call delete('Xsisfile.vim') endfunc " Test for expanding in an autocmd and for and @@ -480,12 +480,12 @@ func Test_source_buffer_vim9() augroup Test au! - au BufNewFile Xfile g:readFile = 1 + au BufNewFile Xsubfile g:readFile = 1 | g:readExtra = 2 augroup END g:readFile = 0 g:readExtra = 0 - new Xfile + new Xsubfile bwipe! augroup Test au! diff --git a/src/testdir/test_stat.vim b/src/testdir/test_stat.vim index de4a204f5d..e801bfc5ce 100644 --- a/src/testdir/test_stat.vim +++ b/src/testdir/test_stat.vim @@ -171,7 +171,7 @@ func Test_getftype() return endif - silent !ln -s Xfile Xlink + silent !ln -s Xlinkfile Xlink call assert_equal('link', getftype('Xlink')) call delete('Xlink') diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim index 7e7ccff0f5..df01e06f3a 100644 --- a/src/testdir/test_substitute.vim +++ b/src/testdir/test_substitute.vim @@ -141,7 +141,7 @@ endfunc func Test_substitute_repeat() " This caused an invalid memory access. - split Xfile + split Xsubfile s/^/x call feedkeys("Qsc\y", 'tx') bwipe! @@ -1068,7 +1068,7 @@ func Test_sub_edit_scriptfile() new norm o0000000000000000000000000000000000000000000000000000 func EditScript() - silent! scr! Xfile + silent! scr! Xsedfile endfunc s/\%')/\=EditScript() diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index 7e105b1254..fe97578b10 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -768,14 +768,14 @@ endfunc func Test_tabpage_close_on_switch() tabnew tabnew - edit Xfile + edit Xtabfile augroup T2 au! - au BufLeave Xfile 1tabclose + au BufLeave Xtabfile 1tabclose augroup END tabfirst call assert_equal(2, tabpagenr()) - call assert_equal('Xfile', @%) + call assert_equal('Xtabfile', @%) augroup T2 au! augroup END diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim index 81606fcf7c..59537ee299 100644 --- a/src/testdir/test_tagjump.vim +++ b/src/testdir/test_tagjump.vim @@ -15,20 +15,20 @@ endfunc func Test_ptjump() CheckFeature quickfix - set tags=Xtags + set tags=Xpttags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "one\tXfile\t1", - \ "three\tXfile\t3", - \ "two\tXfile\t2"], - \ 'Xtags') - call writefile(['one', 'two', 'three'], 'Xfile') + \ "one\tXptfile\t1", + \ "three\tXptfile\t3", + \ "two\tXptfile\t2"], + \ 'Xpttags') + call writefile(['one', 'two', 'three'], 'Xptfile') %bw! ptjump two call assert_equal(2, winnr()) wincmd p call assert_equal(1, &previewwindow) - call assert_equal('Xfile', expand("%:p:t")) + call assert_equal('Xptfile', expand("%:p:t")) call assert_equal(2, line('.')) call assert_equal(2, winnr('$')) call assert_equal(1, winnr()) @@ -38,7 +38,7 @@ func Test_ptjump() call assert_equal(2, winnr()) wincmd p call assert_equal(1, &previewwindow) - call assert_equal('Xfile', expand("%:p:t")) + call assert_equal('Xptfile', expand("%:p:t")) call assert_equal(3, line('.')) call assert_equal(2, winnr('$')) call assert_equal(1, winnr()) @@ -48,8 +48,8 @@ func Test_ptjump() call assert_equal(5, winheight(0)) close - call delete('Xtags') - call delete('Xfile') + call delete('Xpttags') + call delete('Xptfile') set tags& endfunc @@ -73,12 +73,12 @@ func Test_cancel_ptjump() endfunc func Test_static_tagjump() - set tags=Xtags + set tags=Xtjtags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "one\tXfile1\t/^one/;\"\tf\tfile:\tsignature:(void)", - \ "word\tXfile2\tcmd2"], - \ 'Xtags') - new Xfile1 + \ "one\tXtjfile1\t/^one/;\"\tf\tfile:\tsignature:(void)", + \ "word\tXtjfile2\tcmd2"], + \ 'Xtjtags') + new Xtjfile1 call setline(1, ['empty', 'one()', 'empty']) write tag one @@ -86,19 +86,19 @@ func Test_static_tagjump() bwipe! set tags& - call delete('Xtags') - call delete('Xfile1') + call delete('Xtjtags') + call delete('Xtjfile1') endfunc func Test_duplicate_tagjump() - set tags=Xtags + set tags=Xdttags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "thesame\tXfile1\t1;\"\td\tfile:", - \ "thesame\tXfile1\t2;\"\td\tfile:", - \ "thesame\tXfile1\t3;\"\td\tfile:", + \ "thesame\tXdtfile1\t1;\"\td\tfile:", + \ "thesame\tXdtfile1\t2;\"\td\tfile:", + \ "thesame\tXdtfile1\t3;\"\td\tfile:", \ ], - \ 'Xtags') - new Xfile1 + \ 'Xdttags') + new Xdtfile1 call setline(1, ['thesame one', 'thesame two', 'thesame three']) write tag thesame @@ -110,19 +110,19 @@ func Test_duplicate_tagjump() bwipe! set tags& - call delete('Xtags') - call delete('Xfile1') + call delete('Xdttags') + call delete('Xdtfile1') endfunc func Test_tagjump_switchbuf() CheckFeature quickfix - set tags=Xtags + set tags=Xswtags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "second\tXfile1\t2", - \ "third\tXfile1\t3",], - \ 'Xtags') - call writefile(['first', 'second', 'third'], 'Xfile1') + \ "second\tXsbfile1\t2", + \ "third\tXsbfile1\t3",], + \ 'Xswtags') + call writefile(['first', 'second', 'third'], 'Xsbfile1') enew | only set switchbuf= @@ -153,8 +153,8 @@ func Test_tagjump_switchbuf() tabclose! enew | only - call delete('Xfile1') - call delete('Xtags') + call delete('Xsbfile1') + call delete('Xswtags') set tags& set switchbuf&vim endfunc @@ -205,14 +205,14 @@ func Test_tag_symbolic() call writefile([ \ "SECTION_OFF " . getcwd() . "/Xtest.dir/Xtest.c /^#define SECTION_OFF 3$/", \ '', - \ ], 'Xtags') + \ ], 'Xsymtags') call writefile(['#define SECTION_OFF 3', \ '#define NUM_SECTIONS 3'], 'Xtest.c') " Try jumping to a tag, but with a path that contains a symbolic link. When " wrong, this will give the ATTENTION message. The next space will then be " eaten by hit-return, instead of moving the cursor to 'd'. - set tags=Xtags + set tags=Xsymtags enew! call append(0, 'SECTION_OFF') call cursor(1,1) @@ -223,7 +223,7 @@ func Test_tag_symbolic() set hidden& set tags& enew! - call delete('Xtags') + call delete('Xsymtags') call delete('Xtest.c') call delete("Xtest.dir", "rf") %bwipe! @@ -263,12 +263,12 @@ func Test_tag_file_encoding() new let content = ['!_TAG_FILE_ENCODING cp932 //', \ "\x82`\x82a\x82b Xtags2.txt /\x82`\x82a\x82b"] - call writefile(content, 'Xtags') - set tags=Xtags + call writefile(content, 'Xenctags') + set tags=Xenctags tag /.BC call assert_equal('Xtags2.txt', expand('%:t')) call assert_equal('ABC', getline('.')) - call delete('Xtags') + call delete('Xenctags') close " case3: @@ -280,12 +280,12 @@ func Test_tag_file_encoding() call add(contents, 'abc' .. i \ .. " Xtags3.txt /\x82`\x82a\x82b") endfor - call writefile(contents, 'Xtags') - set tags=Xtags + call writefile(contents, 'Xenctags') + set tags=Xenctags tag abc50 call assert_equal('Xtags3.txt', expand('%:t')) call assert_equal('ABC', getline('.')) - call delete('Xtags') + call delete('Xenctags') close set tags& @@ -314,8 +314,8 @@ func Test_tagjump_etags() \ "Xmain.c,64", \ "void foo() {}\x7ffoo\x011,0", \ "int main(int argc, char **argv)\x7fmain\x012,14", - \ ], 'Xtags') - set tags=Xtags + \ ], 'Xtetags') + set tags=Xtetags ta foo call assert_equal('void foo() {}', getline('.')) @@ -328,7 +328,7 @@ func Test_tagjump_etags() \ "Xnonexisting,include", \ "\x0c", \ "Xtags2,include" - \ ], 'Xtags') + \ ], 'Xtetags') call writefile([ \ "\x0c", \ "Xmain.c,64", @@ -343,7 +343,7 @@ func Test_tagjump_etags() \ "\x0c", \ "Xmain.c,8", \ "int main" - \ ], 'Xtags', 'b') + \ ], 'Xtetags', 'b') call assert_fails('tag foo', 'E426:') " invalid line number @@ -351,7 +351,7 @@ func Test_tagjump_etags() \ "\x0c", \ "Xmain.c,64", \ "void foo() {}\x7ffoo\x0abc,0", - \ ], 'Xtags') + \ ], 'Xtetags') call assert_fails('tag foo', 'E426:') " invalid tag name @@ -359,7 +359,7 @@ func Test_tagjump_etags() \ "\x0c", \ "Xmain.c,64", \ ";;;;\x7f1,0", - \ ], 'Xtags') + \ ], 'Xtetags') call assert_fails('tag foo', 'E431:') " end of file after a CTRL-L line @@ -368,14 +368,14 @@ func Test_tagjump_etags() \ "Xmain.c,64", \ "void foo() {}\x7ffoo\x011,0", \ "\x0c", - \ ], 'Xtags') + \ ], 'Xtetags') call assert_fails('tag main', 'E426:') " error in an included tags file call writefile([ \ "\x0c", \ "Xtags2,include" - \ ], 'Xtags') + \ ], 'Xtetags') call writefile([ \ "\x0c", \ "Xmain.c,64", @@ -383,7 +383,7 @@ func Test_tagjump_etags() \ ], 'Xtags2') call assert_fails('tag foo', 'E431:') - call delete('Xtags') + call delete('Xtetags') call delete('Xtags2') call delete('Xmain.c') set tags& @@ -392,9 +392,9 @@ endfunc " Test for getting and modifying the tag stack func Test_getsettagstack() - call writefile(['line1', 'line2', 'line3'], 'Xfile1') - call writefile(['line1', 'line2', 'line3'], 'Xfile2') - call writefile(['line1', 'line2', 'line3'], 'Xfile3') + call writefile(['line1', 'line2', 'line3'], 'Xstsfile1') + call writefile(['line1', 'line2', 'line3'], 'Xstsfile2') + call writefile(['line1', 'line2', 'line3'], 'Xstsfile3') enew | only call settagstack(1, {'items' : []}) @@ -409,12 +409,12 @@ func Test_getsettagstack() call assert_fails("call settagstack(1, {'items' : []}, 'b')", 'E962:') call assert_equal(-1, settagstack(0, test_null_dict())) - set tags=Xtags + set tags=Xtsttags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "one\tXfile1\t1", - \ "three\tXfile3\t3", - \ "two\tXfile2\t2"], - \ 'Xtags') + \ "one\tXstsfile1\t1", + \ "three\tXstsfile3\t3", + \ "two\tXstsfile2\t2"], + \ 'Xtsttags') let stk = [] call add(stk, {'bufnr' : bufnr('%'), 'tagname' : 'one', @@ -495,10 +495,10 @@ func Test_getsettagstack() " Tag with multiple matches call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "two\tXfile1\t1", - \ "two\tXfile2\t3", - \ "two\tXfile3\t2"], - \ 'Xtags') + \ "two\tXstsfile1\t1", + \ "two\tXstsfile2\t3", + \ "two\tXstsfile3\t2"], + \ 'Xtsttags') call settagstack(1, {'items' : []}) tag two tnext @@ -515,10 +515,10 @@ func Test_getsettagstack() call assert_fails('call gettagstack()', 'E342:') call settagstack(1, {'items' : []}) - call delete('Xfile1') - call delete('Xfile2') - call delete('Xfile3') - call delete('Xtags') + call delete('Xstsfile1') + call delete('Xstsfile2') + call delete('Xstsfile3') + call delete('Xtsttags') set tags& endfunc @@ -735,11 +735,11 @@ endfunc " Test for :ptag func Test_tag_preview() call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "second\tXfile1\t2", - \ "third\tXfile1\t3",], + \ "second\tXtpfile1\t2", + \ "third\tXtpfile1\t3",], \ 'Xtags') set tags=Xtags - call writefile(['first', 'second', 'third'], 'Xfile1') + call writefile(['first', 'second', 'third'], 'Xtpfile1') enew | only ptag third @@ -766,7 +766,7 @@ func Test_tag_preview() pclose call assert_equal(1, winnr('$')) - call delete('Xfile1') + call delete('Xtpfile1') call delete('Xtags') set tags& endfunc @@ -1453,24 +1453,24 @@ endfunc func Test_tag_length() set tags=Xtags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "tame\tXfile1\t1;", - \ "tape\tXfile2\t1;"], 'Xtags') - call writefile(['tame'], 'Xfile1') - call writefile(['tape'], 'Xfile2') + \ "tame\tXtlfile1\t1;", + \ "tape\tXtlfile2\t1;"], 'Xtags') + call writefile(['tame'], 'Xtlfile1') + call writefile(['tape'], 'Xtlfile2') " Jumping to the tag 'tape', should instead jump to 'tame' new set taglength=2 tag tape - call assert_equal('Xfile1', @%) + call assert_equal('Xtlfile1', @%) " Tag search should jump to the right tag enew tag /^tape$ - call assert_equal('Xfile2', @%) + call assert_equal('Xtlfile2', @%) call delete('Xtags') - call delete('Xfile1') - call delete('Xfile2') + call delete('Xtlfile1') + call delete('Xtlfile2') set tags& taglength& endfunc diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 93cb74d2a0..238fd865b7 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -641,10 +641,10 @@ endfunc func Test_terminal_cwd_failure() " Case 1: Provided directory is not actually a directory. Attempt to make " the file executable as well. - call writefile([], 'Xfile') - call setfperm('Xfile', 'rwx------') - call assert_fails("call term_start(&shell, {'cwd': 'Xfile'})", 'E475:') - call delete('Xfile') + call writefile([], 'Xtcfile') + call setfperm('Xftcile', 'rwx------') + call assert_fails("call term_start(&shell, {'cwd': 'Xftcile'})", 'E475:') + call delete('Xftcile') " Case 2: Directory does not exist. call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:') @@ -878,12 +878,12 @@ endfunc func Test_terminal_redir_file() let g:test_is_flaky = 1 let cmd = Get_cat_123_cmd() - let buf = term_start(cmd, {'out_io': 'file', 'out_name': 'Xfile'}) + let buf = term_start(cmd, {'out_io': 'file', 'out_name': 'Xtrfile'}) call TermWait(buf) " ConPTY may precede escape sequence. There are things that are not so. if !has('conpty') - call WaitForAssert({-> assert_notequal(0, len(readfile("Xfile")))}) - call assert_match('123', readfile('Xfile')[0]) + call WaitForAssert({-> assert_notequal(0, len(readfile("Xtrfile")))}) + call assert_match('123', readfile('Xtrfile')[0]) endif let g:job = term_getjob(buf) call WaitForAssert({-> assert_equal("dead", job_status(g:job))}) @@ -894,18 +894,18 @@ func Test_terminal_redir_file() " Just wait for a moment. sleep 50m endif - call delete('Xfile') + call delete('Xtrfile') bwipe if has('unix') - call writefile(['one line'], 'Xfile') - let buf = term_start('cat', {'in_io': 'file', 'in_name': 'Xfile'}) + call writefile(['one line'], 'Xtrfile') + let buf = term_start('cat', {'in_io': 'file', 'in_name': 'Xtrfile'}) call TermWait(buf) call WaitForAssert({-> assert_equal('one line', term_getline(buf, 1))}) let g:job = term_getjob(buf) call WaitForAssert({-> assert_equal('dead', job_status(g:job))}) bwipe - call delete('Xfile') + call delete('Xtrfile') endif endfunc diff --git a/src/testdir/test_terminal2.vim b/src/testdir/test_terminal2.vim index a40fc84885..6e70ad6cce 100644 --- a/src/testdir/test_terminal2.vim +++ b/src/testdir/test_terminal2.vim @@ -415,11 +415,11 @@ func Test_terminal_does_not_truncate_last_newlines() \ ] for c in contents - call writefile(c, 'Xfile') + call writefile(c, 'Xdntfile') if has('win32') - term cmd /c type Xfile + term cmd /c type Xdntfile else - term cat Xfile + term cat Xdntfile endif let bnr = bufnr('$') call assert_equal('terminal', getbufvar(bnr, '&buftype')) @@ -429,7 +429,7 @@ func Test_terminal_does_not_truncate_last_newlines() quit endfor - call delete('Xfile') + call delete('Xdntfile') endfunc func GetDummyCmd() diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim index b1ff392149..58dde3f1fe 100644 --- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -2211,7 +2211,7 @@ def Test_script_local_in_legacy() END v9.CheckScriptFailure(lines, 'E476:', 1) - edit! Xfile + edit! Xslfile lines =<< trim END var edit: bool legacy edit diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index b9d8adb404..636769d3ab 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -931,11 +931,11 @@ func Test_command_modifier_confirm() let lines =<< trim END call setline(1, 'changed') def Getout() - confirm write Xfile + confirm write Xcmodfile enddef END call writefile(lines, 'Xconfirmscript') - call writefile(['empty'], 'Xfile') + call writefile(['empty'], 'Xcmodfile') let buf = RunVimInTerminal('-S Xconfirmscript', {'rows': 8}) call term_sendkeys(buf, ":call Getout()\n") call WaitForAssert({-> assert_match('(Y)es, \[N\]o: ', term_getline(buf, 8))}, 1000) @@ -945,9 +945,9 @@ func Test_command_modifier_confirm() call TermWait(buf) call StopVimInTerminal(buf) - call assert_equal(['changed'], readfile('Xfile')) - call delete('Xfile') - call delete('.Xfile.swp') " in case Vim was killed + call assert_equal(['changed'], readfile('Xcmodfile')) + call delete('Xcmodfile') + call delete('.Xcmodfile.swp') " in case Vim was killed call delete('Xconfirmscript') endfunc @@ -1065,13 +1065,13 @@ def Test_command_modifier_other() edit Xsomefile bwipe! - au BufNewFile Xfile g:readFile = 1 + au BufNewFile Xcmofile g:readFile = 1 g:readFile = 0 - edit Xfile + edit Xcmofile assert_equal(1, g:readFile) bwipe! g:readFile = 0 - noautocmd edit Xfile + noautocmd edit Xcmofile assert_equal(0, g:readFile) au! BufNewFile unlet g:readFile @@ -1407,7 +1407,7 @@ def Test_star_command() enddef def Test_cmd_argument_without_colon() - new Xfile + new Xawcfile setline(1, ['a', 'b', 'c', 'd']) write edit +3 % @@ -1415,7 +1415,7 @@ def Test_cmd_argument_without_colon() edit +/a % assert_equal(1, getcurpos()[1]) bwipe - delete('Xfile') + delete('Xawcfile') enddef def Test_ambiguous_user_cmd() @@ -1882,7 +1882,7 @@ def Test_redir_to_var() var text: string redir => text echo 'hello' - redir > Xfile + redir > Xnopfile redir END END v9.CheckDefFailure(lines, 'E1092:') @@ -2025,10 +2025,10 @@ enddef " Test for the 'previewpopup' option def Test_previewpopup() set previewpopup=height:10,width:60 - pedit Xfile + pedit Xppfile var id = popup_findpreview() assert_notequal(id, 0) - assert_match('Xfile', popup_getoptions(id).title) + assert_match('Xppfile', popup_getoptions(id).title) popup_clear() set previewpopup& enddef diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index 6ae2e2fea8..b688296f36 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -1414,13 +1414,13 @@ def Test_import_in_charconvert() END v9.CheckScriptSuccess(lines) - writefile(['one', 'two'], 'Xfile') - new Xfile - write ++enc=ucase Xfile1 - assert_equal(['ONE', 'TWO'], readfile('Xfile1')) + writefile(['one', 'two'], 'Xiicfile') + new Xiicfile + write ++enc=ucase Xiicfile1 + assert_equal(['ONE', 'TWO'], readfile('Xiicfile1')) - delete('Xfile') - delete('Xfile1') + delete('Xiicfile') + delete('Xiicfile1') delete('Xconvert.vim') bwipe! set charconvert& diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index bdefc8756a..aeee143297 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -968,11 +968,11 @@ def Test_cnext_works_in_catch() var lines =<< trim END vim9script au BufEnter * eval 1 + 2 - writefile(['text'], 'Xfile1') - writefile(['text'], 'Xfile2') + writefile(['text'], 'Xcncfile1') + writefile(['text'], 'Xcncfile2') var items = [ - {lnum: 1, filename: 'Xfile1', valid: true}, - {lnum: 1, filename: 'Xfile2', valid: true} + {lnum: 1, filename: 'Xcncfile1', valid: true}, + {lnum: 1, filename: 'Xcncfile2', valid: true} ] setqflist([], ' ', {items: items}) cwindow @@ -988,17 +988,17 @@ def Test_cnext_works_in_catch() CnextOrCfirst() CnextOrCfirst() - writefile([getqflist({idx: 0}).idx], 'Xresult') + writefile([getqflist({idx: 0}).idx], 'Xcncresult') qall END writefile(lines, 'XCatchCnext') g:RunVim([], [], '--clean -S XCatchCnext') - assert_equal(['1'], readfile('Xresult')) + assert_equal(['1'], readfile('Xcncresult')) - delete('Xfile1') - delete('Xfile2') + delete('Xcncfile1') + delete('Xcncfile2') delete('XCatchCnext') - delete('Xresult') + delete('Xcncresult') enddef def Test_throw_skipped() @@ -2708,7 +2708,7 @@ def Test_vim9_comment() '#{something', ], 'E1170:') - split Xfile + split Xv9cfile v9.CheckScriptSuccess([ 'vim9script', 'edit #something', @@ -3544,20 +3544,20 @@ def Test_restoring_cpo() mkdir('Xhome') var lines =<< trim END vim9script - writefile(['before: ' .. &cpo], 'Xresult') + writefile(['before: ' .. &cpo], 'Xrporesult') set cpo+=M - writefile(['after: ' .. &cpo], 'Xresult', 'a') + writefile(['after: ' .. &cpo], 'Xrporesult', 'a') END writefile(lines, 'Xhome/.vimrc') lines =<< trim END - call writefile(['later: ' .. &cpo], 'Xresult', 'a') + call writefile(['later: ' .. &cpo], 'Xrporesult', 'a') END writefile(lines, 'Xlegacy') lines =<< trim END vim9script - call writefile(['vim9: ' .. &cpo], 'Xresult', 'a') + call writefile(['vim9: ' .. &cpo], 'Xrporesult', 'a') qa END writefile(lines, 'Xvim9') @@ -3570,13 +3570,13 @@ def Test_restoring_cpo() 'before: aABceFs', 'after: aABceFsM', 'later: aABceFsM', - 'vim9: aABceFs'], readfile('Xresult')) + 'vim9: aABceFs'], readfile('Xrporesult')) $HOME = save_HOME delete('Xhome', 'rf') delete('Xlegacy') delete('Xvim9') - delete('Xresult') + delete('Xrporesult') endif enddef diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim index cde70bd1c6..31ce8293af 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim @@ -1472,7 +1472,7 @@ endfunc func Test_visual_area_adjusted_when_hiding() " The Visual area ended after the end of the line after :hide call setline(1, 'xxx') - vsplit Xfile + vsplit Xvaafile call setline(1, 'xxxxxxxx') norm! $o hid diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index bea612f236..44fd646392 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -1083,12 +1083,12 @@ func Run_noroom_for_newwindow_test(dir_arg) endtry endwhile - call writefile(['first', 'second', 'third'], 'Xfile1') - call writefile([], 'Xfile2') - call writefile([], 'Xfile3') + call writefile(['first', 'second', 'third'], 'Xnorfile1') + call writefile([], 'Xnorfile2') + call writefile([], 'Xnorfile3') " Argument list related commands - args Xfile1 Xfile2 Xfile3 + args Xnorfile1 Xnorfile2 Xnorfile3 next for cmd in ['sargument 2', 'snext', 'sprevious', 'sNext', 'srewind', \ 'sfirst', 'slast'] @@ -1099,13 +1099,13 @@ func Run_noroom_for_newwindow_test(dir_arg) " Buffer related commands set modified hide enew - for cmd in ['sbuffer Xfile1', 'sbnext', 'sbprevious', 'sbNext', 'sbrewind', + for cmd in ['sbuffer Xnorfile1', 'sbnext', 'sbprevious', 'sbNext', 'sbrewind', \ 'sbfirst', 'sblast', 'sball', 'sbmodified', 'sunhide'] call assert_fails(dir .. cmd, 'E36:') endfor " Window related commands - for cmd in ['split', 'split Xfile2', 'new', 'new Xfile3', 'sview Xfile1', + for cmd in ['split', 'split Xnorfile2', 'new', 'new Xnorfile3', 'sview Xnorfile1', \ 'sfind runtest.vim'] call assert_fails(dir .. cmd, 'E36:') endfor @@ -1128,7 +1128,7 @@ func Run_noroom_for_newwindow_test(dir_arg) call assert_fails(dir .. 'lopen', 'E36:') " Preview window - call assert_fails(dir .. 'pedit Xfile2', 'E36:') + call assert_fails(dir .. 'pedit Xnorfile2', 'E36:') call setline(1, 'abc') call assert_fails(dir .. 'psearch abc', 'E36:') endif @@ -1136,15 +1136,15 @@ func Run_noroom_for_newwindow_test(dir_arg) " Window commands (CTRL-W ^ and CTRL-W f) if a:dir_arg == 'h' call assert_fails('call feedkeys("\^", "xt")', 'E36:') - call setline(1, 'Xfile1') + call setline(1, 'Xnorfile1') call assert_fails('call feedkeys("gg\f", "xt")', 'E36:') endif enew! " Tag commands (:stag, :stselect and :stjump) call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", - \ "second\tXfile1\t2", - \ "third\tXfile1\t3",], + \ "second\tXnorfile1\t2", + \ "third\tXnorfile1\t3",], \ 'Xtags') set tags=Xtags call assert_fails(dir .. 'stag second', 'E36:') @@ -1166,9 +1166,9 @@ func Run_noroom_for_newwindow_test(dir_arg) endif %bwipe! - call delete('Xfile1') - call delete('Xfile2') - call delete('Xfile3') + call delete('Xnorfile1') + call delete('Xnorfile2') + call delete('Xnorfile3') only endfunc @@ -1387,16 +1387,16 @@ endfunc " window to another. func Test_close_dest_window() split - edit Xfile + edit Xdstfile " Test for BufLeave augroup T1 au! - au BufLeave Xfile $wincmd c + au BufLeave Xdstfile $wincmd c augroup END wincmd b call assert_equal(1, winnr('$')) - call assert_equal('Xfile', @%) + call assert_equal('Xdstfile', @%) augroup T1 au! augroup END @@ -1410,7 +1410,7 @@ func