diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-02 21:55:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-02 21:55:50 +0100 |
commit | b18b49699776485150b71626069a40d12d2c5590 (patch) | |
tree | e583af125f2624cedd5420ba218f9628b122e209 /src | |
parent | f5724376ab7362b5a98eaa8a331d663ef722c2a2 (diff) |
patch 9.0.0363: common names in test files causes tests to be flakyv9.0.0363
Problem: Common names in test files causes tests to be flaky.
Solution: Use more specific names.
Diffstat (limited to 'src')
37 files changed, 566 insertions, 564 deletions
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\<CR>visual\<CR>", 'xt') + call feedkeys("Qr Xcmdfile\<CR>visual\<CR>", '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 <cword>')) call assert_equal('e Vim!@#', expandcmd('e <cWORD>')) 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 <afile>', expandcmd("make <afile>")) call assert_equal('make <amatch>', expandcmd("make <amatch>")) 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\<CR>", "eins\<CR>", "\<CR>", "zwei\<CR>", "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", "", "\<Tab>a"], 'Xfile') + call writefile(["a", "", "\<Tab>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\<C-W>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('<NL>')) + call assert_match('Question: Save changes to "Xdialfile"?', readfile('Xdialog')->join('<NL>')) 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\<C-P>" 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 |