Mercurial > vim
changeset 29970:d891115c0aea v9.0.0323
patch 9.0.0323: using common name in tests leads to flaky tests
Commit: https://github.com/vim/vim/commit/3b0d70f4ff436cb144683dafd956e8a3ee485a90
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 29 22:31:20 2022 +0100
patch 9.0.0323: using common name in tests leads to flaky tests
Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Aug 2022 23:45:04 +0200 |
parents | 5f2d38cacd6c |
children | deea43757ab2 |
files | src/testdir/test_autocmd.vim src/testdir/test_cd.vim src/testdir/test_channel.vim src/testdir/test_checkpath.vim src/testdir/test_cmdline.vim src/testdir/test_delete.vim src/testdir/test_edit.vim src/testdir/test_excmd.vim src/testdir/test_findfile.vim src/testdir/test_functions.vim src/testdir/test_getcwd.vim src/testdir/test_gui.vim src/testdir/test_help.vim src/testdir/test_ins_complete.vim src/testdir/test_packadd.vim src/testdir/test_quickfix.vim src/testdir/test_startup.vim src/testdir/test_terminal.vim src/testdir/test_vim9_disassemble.vim src/testdir/test_vim9_func.vim src/testdir/test_vim9_import.vim src/testdir/test_vim9_script.vim src/testdir/test_viminfo.vim src/testdir/test_writefile.vim src/version.c |
diffstat | 25 files changed, 539 insertions(+), 538 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -717,14 +717,14 @@ func Test_BufEnter() call assert_equal('++', g:val) " Also get BufEnter when editing a directory - call mkdir('Xdir') - split Xdir + call mkdir('Xbufenterdir') + split Xbufenterdir call assert_equal('+++', g:val) " On MS-Windows we can't edit the directory, make sure we wipe the right " buffer. - bwipe! Xdir - call delete('Xdir', 'd') + bwipe! Xbufenterdir + call delete('Xbufenterdir', 'd') au! BufEnter " Editing a "nofile" buffer doesn't read the file but does trigger BufEnter @@ -2723,16 +2723,16 @@ func Test_throw_in_BufWritePre() endfunc func Test_autocmd_in_try_block() - call mkdir('Xdir') + call mkdir('Xintrydir') au BufEnter * let g:fname = expand('%') try - edit Xdir/ + edit Xintrydir/ endtry - call assert_match('Xdir', g:fname) + call assert_match('Xintrydir', g:fname) unlet g:fname au! BufEnter - call delete('Xdir', 'rf') + call delete('Xintrydir', 'rf') endfunc func Test_autocmd_SafeState()
--- a/src/testdir/test_cd.vim +++ b/src/testdir/test_cd.vim @@ -69,11 +69,11 @@ endfunc " Test for chdir() func Test_chdir_func() let topdir = getcwd() - call mkdir('Xdir/y/z', 'p') + call mkdir('Xchdir/y/z', 'p') " Create a few tabpages and windows with different directories new - cd Xdir + cd Xchdir tabnew tcd y below new @@ -81,22 +81,22 @@ func Test_chdir_func() lcd z tabfirst - call assert_match('^\[global\] .*/Xdir$', trim(execute('verbose pwd'))) + call assert_match('^\[global\] .*/Xchdir$', trim(execute('verbose pwd'))) call chdir('..') call assert_equal('y', fnamemodify(getcwd(1, 2), ':t')) call assert_equal('z', fnamemodify(3->getcwd(2), ':t')) tabnext | wincmd t call assert_match('^\[tabpage\] .*/y$', trim(execute('verbose pwd'))) eval '..'->chdir() - call assert_equal('Xdir', fnamemodify(getcwd(1, 2), ':t')) - call assert_equal('Xdir', fnamemodify(getcwd(2, 2), ':t')) + call assert_equal('Xchdir', fnamemodify(getcwd(1, 2), ':t')) + call assert_equal('Xchdir', fnamemodify(getcwd(2, 2), ':t')) call assert_equal('z', fnamemodify(getcwd(3, 2), ':t')) call assert_equal('testdir', fnamemodify(getcwd(1, 1), ':t')) 3wincmd w call assert_match('^\[window\] .*/z$', trim(execute('verbose pwd'))) call chdir('..') - call assert_equal('Xdir', fnamemodify(getcwd(1, 2), ':t')) - call assert_equal('Xdir', fnamemodify(getcwd(2, 2), ':t')) + call assert_equal('Xchdir', fnamemodify(getcwd(1, 2), ':t')) + call assert_equal('Xchdir', fnamemodify(getcwd(2, 2), ':t')) call assert_equal('y', fnamemodify(getcwd(3, 2), ':t')) call assert_equal('testdir', fnamemodify(getcwd(1, 1), ':t')) @@ -110,20 +110,20 @@ func Test_chdir_func() only | tabonly call chdir(topdir) - call delete('Xdir', 'rf') + call delete('Xchdir', 'rf') endfunc " Test for changing to the previous directory '-' func Test_prev_dir() let topdir = getcwd() - call mkdir('Xdir/a/b/c', 'p') + call mkdir('Xprevdir/a/b/c', 'p') " Create a few tabpages and windows with different directories new | only tabnew | new tabnew tabfirst - cd Xdir + cd Xprevdir tabnext | wincmd t tcd a wincmd w @@ -143,7 +143,7 @@ func Test_prev_dir() " Check the directory of all the windows tabfirst - call assert_equal('Xdir', fnamemodify(getcwd(), ':t')) + call assert_equal('Xprevdir', fnamemodify(getcwd(), ':t')) tabnext | wincmd t call assert_equal('a', fnamemodify(getcwd(), ':t')) wincmd w @@ -163,7 +163,7 @@ func Test_prev_dir() " Check the directory of all the windows tabfirst - call assert_equal('Xdir', fnamemodify(getcwd(), ':t')) + call assert_equal('Xprevdir', fnamemodify(getcwd(), ':t')) tabnext | wincmd t call assert_equal('a', fnamemodify(getcwd(), ':t')) wincmd w @@ -173,7 +173,7 @@ func Test_prev_dir() only | tabonly call chdir(topdir) - call delete('Xdir', 'rf') + call delete('Xprevdir', 'rf') endfunc func Test_lcd_split()
--- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -2281,9 +2281,9 @@ func Test_zz_ch_log() let text = readfile('Xlog') call assert_match("hello there", text[1]) call assert_match("%s%s", text[2]) - call mkdir("Xdir1") - call assert_fails("call ch_logfile('Xdir1')", 'E484:') - cal delete("Xdir1", 'd') + call mkdir("Xchlogdir1") + call assert_fails("call ch_logfile('Xchlogdir1')", 'E484:') + cal delete("Xchlogdir1", 'd') call delete('Xlog') endfunc
--- a/src/testdir/test_checkpath.vim +++ b/src/testdir/test_checkpath.vim @@ -2,28 +2,28 @@ " Test for 'include' without \zs or \ze func Test_checkpath1() - call mkdir("Xdir1/dir2", "p") - call writefile(['#include "bar.a"'], 'Xdir1/dir2/foo.a') - call writefile(['#include "baz.a"'], 'Xdir1/dir2/bar.a') - call writefile(['#include "foo.a"'], 'Xdir1/dir2/baz.a') + 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') call writefile(['#include <foo.a>'], 'Xbase.a') edit Xbase.a - set path=Xdir1/dir2 + set path=Xcheckdir1/dir2 let res = split(execute("checkpath!"), "\n") call assert_equal([ \ '--- Included files in path ---', - \ 'Xdir1/dir2/foo.a', - \ 'Xdir1/dir2/foo.a -->', - \ ' Xdir1/dir2/bar.a', - \ ' Xdir1/dir2/bar.a -->', - \ ' Xdir1/dir2/baz.a', - \ ' Xdir1/dir2/baz.a -->', + \ 'Xcheckdir1/dir2/foo.a', + \ 'Xcheckdir1/dir2/foo.a -->', + \ ' Xcheckdir1/dir2/bar.a', + \ ' Xcheckdir1/dir2/bar.a -->', + \ ' Xcheckdir1/dir2/baz.a', + \ ' Xcheckdir1/dir2/baz.a -->', \ ' "foo.a" (Already listed)'], res) enew call delete("./Xbase.a") - call delete("Xdir1", "rf") + call delete("Xcheckdir1", "rf") set path& endfunc @@ -33,31 +33,31 @@ endfunc " Test for 'include' with \zs and \ze func Test_checkpath2() - call mkdir("Xdir1/dir2", "p") - call writefile(['%inc /bar/'], 'Xdir1/dir2/foo.b') - call writefile(['%inc /baz/'], 'Xdir1/dir2/bar.b') - call writefile(['%inc /foo/'], 'Xdir1/dir2/baz.b') + 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()' edit Xbase.b - set path=Xdir1/dir2 + set path=Xcheckdir2/dir2 let res = split(execute("checkpath!"), "\n") call assert_equal([ \ '--- Included files in path ---', - \ 'Xdir1/dir2/foo.b', - \ 'Xdir1/dir2/foo.b -->', - \ ' Xdir1/dir2/bar.b', - \ ' Xdir1/dir2/bar.b -->', - \ ' Xdir1/dir2/baz.b', - \ ' Xdir1/dir2/baz.b -->', + \ 'Xcheckdir2/dir2/foo.b', + \ 'Xcheckdir2/dir2/foo.b -->', + \ ' Xcheckdir2/dir2/bar.b', + \ ' Xcheckdir2/dir2/bar.b -->', + \ ' Xcheckdir2/dir2/baz.b', + \ ' Xcheckdir2/dir2/baz.b -->', \ ' foo (Already listed)'], res) enew call delete("./Xbase.b") - call delete("Xdir1", "rf") + call delete("Xcheckdir2", "rf") set path& set include& set includeexpr& @@ -72,32 +72,32 @@ endfunc " Test for 'include' with \zs and no \ze func Test_checkpath3() - call mkdir("Xdir1/dir2", "p") - call writefile(['%inc bar.c'], 'Xdir1/dir2/foo.c') - call writefile(['%inc baz.c'], 'Xdir1/dir2/bar.c') - call writefile(['%inc foo.c'], 'Xdir1/dir2/baz.c') - call writefile(['%inc foo.c'], 'Xdir1/dir2/FALSE.c') + 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()' edit Xbase.c - set path=Xdir1/dir2 + set path=Xcheckdir3/dir2 let res = split(execute("checkpath!"), "\n") call assert_equal([ \ '--- Included files in path ---', - \ 'Xdir1/dir2/foo.c', - \ 'Xdir1/dir2/foo.c -->', - \ ' Xdir1/dir2/bar.c', - \ ' Xdir1/dir2/bar.c -->', - \ ' Xdir1/dir2/baz.c', - \ ' Xdir1/dir2/baz.c -->', + \ 'Xcheckdir3/dir2/foo.c', + \ 'Xcheckdir3/dir2/foo.c -->', + \ ' Xcheckdir3/dir2/bar.c', + \ ' Xcheckdir3/dir2/bar.c -->', + \ ' Xcheckdir3/dir2/baz.c', + \ ' Xcheckdir3/dir2/baz.c -->', \ ' foo.c (Already listed)'], res) enew call delete("./Xbase.c") - call delete("Xdir1", "rf") + call delete("Xcheckdir3", "rf") set path& set include& set includeexpr&
--- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -83,38 +83,38 @@ func Test_complete_list() endfunc func Test_complete_wildmenu() - call mkdir('Xdir1/Xdir2', 'p') - call writefile(['testfile1'], 'Xdir1/Xtestfile1') - call writefile(['testfile2'], 'Xdir1/Xtestfile2') - call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile3') - call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile4') + call mkdir('Xwilddir1/Xdir2', 'p') + call writefile(['testfile1'], 'Xwilddir1/Xtestfile1') + call writefile(['testfile2'], 'Xwilddir1/Xtestfile2') + call writefile(['testfile3'], 'Xwilddir1/Xdir2/Xtestfile3') + call writefile(['testfile3'], 'Xwilddir1/Xdir2/Xtestfile4') set wildmenu " Pressing <Tab> completes, and moves to next files when pressing again. - call feedkeys(":e Xdir1/\<Tab>\<Tab>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<Tab>\<CR>", 'tx') call assert_equal('testfile1', getline(1)) - call feedkeys(":e Xdir1/\<Tab>\<Tab>\<Tab>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<Tab>\<Tab>\<CR>", 'tx') call assert_equal('testfile2', getline(1)) " <S-Tab> is like <Tab> but begin with the last match and then go to " previous. - call feedkeys(":e Xdir1/Xtest\<S-Tab>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/Xtest\<S-Tab>\<CR>", 'tx') call assert_equal('testfile2', getline(1)) - call feedkeys(":e Xdir1/Xtest\<S-Tab>\<S-Tab>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/Xtest\<S-Tab>\<S-Tab>\<CR>", 'tx') call assert_equal('testfile1', getline(1)) " <Left>/<Right> to move to previous/next file. - call feedkeys(":e Xdir1/\<Tab>\<Right>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<Right>\<CR>", 'tx') call assert_equal('testfile1', getline(1)) - call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<Right>\<Right>\<CR>", 'tx') call assert_equal('testfile2', getline(1)) - call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<Left>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<Right>\<Right>\<Left>\<CR>", 'tx') call assert_equal('testfile1', getline(1)) " <Up>/<Down> to go up/down directories. - call feedkeys(":e Xdir1/\<Tab>\<Down>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<Down>\<CR>", 'tx') call assert_equal('testfile3', getline(1)) - call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx') call assert_equal('testfile1', getline(1)) " this fails in some Unix GUIs, not sure why @@ -124,9 +124,9 @@ func Test_complete_wildmenu() set wildcharm=<C-Z> cnoremap <C-J> <Down><C-Z> cnoremap <C-K> <Up><C-Z> - call feedkeys(":e Xdir1/\<Tab>\<C-J>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<C-J>\<CR>", 'tx') call assert_equal('testfile3', getline(1)) - call feedkeys(":e Xdir1/\<Tab>\<C-J>\<C-K>\<CR>", 'tx') + call feedkeys(":e Xwilddir1/\<Tab>\<C-J>\<C-K>\<CR>", 'tx') call assert_equal('testfile1', getline(1)) set wildcharm=0 cunmap <C-J> @@ -135,21 +135,21 @@ func Test_complete_wildmenu() " Test for canceling the wild menu by adding a character redrawstatus - call feedkeys(":e Xdir1/\<Tab>x\<C-B>\"\<CR>", 'xt') - call assert_equal('"e Xdir1/Xdir2/x', @:) + call feedkeys(":e Xwilddir1/\<Tab>x\<C-B>\"\<CR>", 'xt') + call assert_equal('"e Xwilddir1/Xdir2/x', @:) " Completion using a relative path - cd Xdir1/Xdir2 + cd Xwilddir1/Xdir2 call feedkeys(":e ../\<Tab>\<Right>\<Down>\<C-A>\<C-B>\"\<CR>", 'tx') call assert_equal('"e Xtestfile3 Xtestfile4', @:) cd - " test for wildmenumode() cnoremap <expr> <F2> wildmenumode() - call feedkeys(":cd Xdir\<Tab>\<F2>\<C-B>\"\<CR>", 'tx') - call assert_equal('"cd Xdir1/0', @:) - call feedkeys(":e Xdir1/\<Tab>\<F2>\<C-B>\"\<CR>", 'tx') - call assert_equal('"e Xdir1/Xdir2/1', @:) + call feedkeys(":cd Xwilddir\<Tab>\<F2>\<C-B>\"\<CR>", 'tx') + call assert_equal('"cd Xwilddir1/0', @:) + call feedkeys(":e Xwilddir1/\<Tab>\<F2>\<C-B>\"\<CR>", 'tx') + call assert_equal('"e Xwilddir1/Xdir2/1', @:) cunmap <F2> " Test for canceling the wild menu by pressing <PageDown> or <PageUp>. @@ -162,7 +162,7 @@ func Test_complete_wildmenu() " cleanup %bwipe - call delete('Xdir1', 'rf') + call delete('Xwilddir1', 'rf') set nowildmenu endfunc @@ -1930,18 +1930,18 @@ endfunc func Test_wildmenu_dirstack() CheckUnix %bw! - call mkdir('Xdir1/dir2/dir3/dir4', 'p') - call writefile([], 'Xdir1/file1_1.txt') - call writefile([], 'Xdir1/file1_2.txt') - call writefile([], 'Xdir1/dir2/file2_1.txt') - call writefile([], 'Xdir1/dir2/file2_2.txt') - call writefile([], 'Xdir1/dir2/dir3/file3_1.txt') - call writefile([], 'Xdir1/dir2/dir3/file3_2.txt') - call writefile([], 'Xdir1/dir2/dir3/dir4/file4_1.txt') - call writefile([], 'Xdir1/dir2/dir3/dir4/file4_2.txt') + 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') + call writefile([], 'Xwildmenu/dir2/file2_2.txt') + call writefile([], 'Xwildmenu/dir2/dir3/file3_1.txt') + call writefile([], 'Xwildmenu/dir2/dir3/file3_2.txt') + call writefile([], 'Xwildmenu/dir2/dir3/dir4/file4_1.txt') + call writefile([], 'Xwildmenu/dir2/dir3/dir4/file4_2.txt') set wildmenu - cd Xdir1/dir2/dir3/dir4 + cd Xwildmenu/dir2/dir3/dir4 call feedkeys(":e \<Tab>\<C-B>\"\<CR>", 'xt') call assert_equal('"e file4_1.txt', @:) call feedkeys(":e \<Tab>\<Up>\<C-B>\"\<CR>", 'xt') @@ -1955,10 +1955,10 @@ func Test_wildmenu_dirstack() call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<Down>\<C-B>\"\<CR>", 'xt') call assert_equal('"e ../../dir3/dir4/file4_1.txt', @:) cd - - call feedkeys(":e Xdir1/\<Tab>\<Down>\<Down>\<Down>\<C-B>\"\<CR>", 'xt') - call assert_equal('"e Xdir1/dir2/dir3/dir4/file4_1.txt', @:) - - call delete('Xdir1', 'rf') + 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
--- a/src/testdir/test_delete.vim +++ b/src/testdir/test_delete.vim @@ -14,32 +14,32 @@ func Test_file_delete() endfunc func Test_dir_delete() - call mkdir('Xdir1') - call assert_true(isdirectory('Xdir1')) - call assert_equal(0, delete('Xdir1', 'd')) - call assert_false(isdirectory('Xdir1')) - call assert_equal(-1, delete('Xdir1', 'd')) + call mkdir('Xdirdel') + call assert_true(isdirectory('Xdirdel')) + call assert_equal(0, delete('Xdirdel', 'd')) + call assert_false(isdirectory('Xdirdel')) + call assert_equal(-1, delete('Xdirdel', 'd')) endfunc func Test_recursive_delete() - call mkdir('Xdir1') - call mkdir('Xdir1/subdir') - call mkdir('Xdir1/empty') - split Xdir1/Xfile + call mkdir('Xrecdel') + call mkdir('Xrecdel/subdir') + call mkdir('Xrecdel/empty') + split Xrecdel/Xfile call setline(1, ['a', 'b']) w - w Xdir1/subdir/Xfile + w Xrecdel/subdir/Xfile close - call assert_true(isdirectory('Xdir1')) - call assert_equal(['a', 'b'], readfile('Xdir1/Xfile')) - call assert_true(isdirectory('Xdir1/subdir')) - call assert_equal(['a', 'b'], readfile('Xdir1/subdir/Xfile')) - call assert_true('Xdir1/empty'->isdirectory()) - call assert_equal(0, delete('Xdir1', 'rf')) - call assert_false(isdirectory('Xdir1')) - call assert_equal(-1, delete('Xdir1', 'd')) - bwipe Xdir1/Xfile - bwipe Xdir1/subdir/Xfile + call assert_true(isdirectory('Xrecdel')) + call assert_equal(['a', 'b'], readfile('Xrecdel/Xfile')) + call assert_true(isdirectory('Xrecdel/subdir')) + call assert_equal(['a', 'b'], readfile('Xrecdel/subdir/Xfile')) + call assert_true('Xrecdel/empty'->isdirectory()) + call assert_equal(0, delete('Xrecdel', 'rf')) + call assert_false(isdirectory('Xrecdel')) + call assert_equal(-1, delete('Xrecdel', 'd')) + bwipe Xrecdel/Xfile + bwipe Xrecdel/subdir/Xfile endfunc func Test_symlink_delete() @@ -47,59 +47,59 @@ func Test_symlink_delete() split Xfile call setline(1, ['a', 'b']) wq - silent !ln -s Xfile Xlink + silent !ln -s Xfile Xdellink " Delete the link, not the file - call assert_equal(0, delete('Xlink')) - call assert_equal(-1, delete('Xlink')) + call assert_equal(0, delete('Xdellink')) + call assert_equal(-1, delete('Xdellink')) call assert_equal(0, delete('Xfile')) bwipe Xfile endfunc func Test_symlink_dir_delete() CheckUnix - call mkdir('Xdir1') - silent !ln -s Xdir1 Xlink - call assert_true(isdirectory('Xdir1')) - call assert_true(isdirectory('Xlink')) + call mkdir('Xsymdir') + silent !ln -s Xsymdir Xdirlink + call assert_true(isdirectory('Xsymdir')) + call assert_true(isdirectory('Xdirlink')) " Delete the link, not the directory - call assert_equal(0, delete('Xlink')) - call assert_equal(-1, delete('Xlink')) - call assert_equal(0, delete('Xdir1', 'd')) + call assert_equal(0, delete('Xdirlink')) + call assert_equal(-1, delete('Xdirlink')) + call assert_equal(0, delete('Xsymdir', 'd')) endfunc func Test_symlink_recursive_delete() CheckUnix - call mkdir('Xdir3') - call mkdir('Xdir3/subdir') - call mkdir('Xdir4') - split Xdir3/Xfile + call mkdir('Xrecdir3') + call mkdir('Xrecdir3/subdir') + call mkdir('Xrecdir4') + split Xrecdir3/Xfile call setline(1, ['a', 'b']) w - w Xdir3/subdir/Xfile - w Xdir4/Xfile + w Xrecdir3/subdir/Xfile + w Xrecdir4/Xfile close - silent !ln -s ../Xdir4 Xdir3/Xlink + silent !ln -s ../Xrecdir4 Xrecdir3/Xreclink - call assert_true(isdirectory('Xdir3')) - call assert_equal(['a', 'b'], readfile('Xdir3/Xfile')) - call assert_true(isdirectory('Xdir3/subdir')) - call assert_equal(['a', 'b'], readfile('Xdir3/subdir/Xfile')) - call assert_true(isdirectory('Xdir4')) - call assert_true(isdirectory('Xdir3/Xlink')) - call assert_equal(['a', 'b'], readfile('Xdir4/Xfile')) + call assert_true(isdirectory('Xrecdir3')) + call assert_equal(['a', 'b'], readfile('Xrecdir3/Xfile')) + call assert_true(isdirectory('Xrecdir3/subdir')) + call assert_equal(['a', 'b'], readfile('Xrecdir3/subdir/Xfile')) + call assert_true(isdirectory('Xrecdir4')) + call assert_true(isdirectory('Xrecdir3/Xreclink')) + call assert_equal(['a', 'b'], readfile('Xrecdir4/Xfile')) - call assert_equal(0, delete('Xdir3', 'rf')) - call assert_false(isdirectory('Xdir3')) - call assert_equal(-1, delete('Xdir3', 'd')) + call assert_equal(0, delete('Xrecdir3', 'rf')) + call assert_false(isdirectory('Xrecdir3')) + call assert_equal(-1, delete('Xrecdir3', 'd')) " symlink is deleted, not the directory it points to - call assert_true(isdirectory('Xdir4')) - call assert_equal(['a', 'b'], readfile('Xdir4/Xfile')) - call assert_equal(0, delete('Xdir4/Xfile')) - call assert_equal(0, delete('Xdir4', 'd')) + call assert_true(isdirectory('Xrecdir4')) + call assert_equal(['a', 'b'], readfile('Xrecdir4/Xfile')) + call assert_equal(0, delete('Xrecdir4/Xfile')) + call assert_equal(0, delete('Xrecdir4', 'd')) - bwipe Xdir3/Xfile - bwipe Xdir3/subdir/Xfile - bwipe Xdir4/Xfile + bwipe Xrecdir3/Xfile + bwipe Xrecdir3/subdir/Xfile + bwipe Xrecdir4/Xfile endfunc func Test_delete_errors()
--- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -1492,7 +1492,7 @@ func Test_edit_complete_very_long_name() " Long directory names only work on Unix. CheckUnix - let dirname = getcwd() . "/Xdir" + let dirname = getcwd() . "/Xlongdir" let longdirname = dirname . repeat('/' . repeat('d', 255), 4) try call mkdir(longdirname, 'p') @@ -1729,7 +1729,7 @@ endfunc " Test for editing a directory func Test_edit_is_a_directory() CheckEnglish - let dirname = getcwd() . "/Xdir" + let dirname = getcwd() . "/Xeditdir" call mkdir(dirname, 'p') new
--- a/src/testdir/test_excmd.vim +++ b/src/testdir/test_excmd.vim @@ -489,9 +489,9 @@ func Test_redir_cmd() if has('unix') " Redirecting to a directory name - call mkdir('Xdir') - call assert_fails('redir > Xdir', 'E17:') - call delete('Xdir', 'd') + call mkdir('Xredir') + call assert_fails('redir > Xredir', 'E17:') + call delete('Xredir', 'd') endif " Test for redirecting to a register
--- a/src/testdir/test_findfile.vim +++ b/src/testdir/test_findfile.vim @@ -1,14 +1,14 @@ " Test findfile() and finddir() -let s:files = [ 'Xdir1/foo', - \ 'Xdir1/bar', - \ 'Xdir1/Xdir2/foo', - \ 'Xdir1/Xdir2/foobar', - \ 'Xdir1/Xdir2/Xdir3/bar', - \ 'Xdir1/Xdir2/Xdir3/barfoo' ] +let s:files = [ 'Xfinddir1/foo', + \ 'Xfinddir1/bar', + \ 'Xfinddir1/Xdir2/foo', + \ 'Xfinddir1/Xdir2/foobar', + \ 'Xfinddir1/Xdir2/Xdir3/bar', + \ 'Xfinddir1/Xdir2/Xdir3/barfoo' ] func CreateFiles() - call mkdir('Xdir1/Xdir2/Xdir3/Xdir2', 'p') + call mkdir('Xfinddir1/Xdir2/Xdir3/Xdir2', 'p') for f in s:files call writefile([], f) endfor @@ -16,15 +16,15 @@ endfunc func CleanFiles() " Safer to delete each file even if it's more verbose - " than doing a recursive delete('Xdir1', 'rf'). + " than doing a recursive delete('Xfinddir1', 'rf'). for f in s:files call delete(f) endfor - call delete('Xdir1/Xdir2/Xdir3/Xdir2', 'd') - call delete('Xdir1/Xdir2/Xdir3', 'd') - call delete('Xdir1/Xdir2', 'd') - call delete('Xdir1', 'd') + call delete('Xfinddir1/Xdir2/Xdir3/Xdir2', 'd') + call delete('Xfinddir1/Xdir2/Xdir3', 'd') + call delete('Xfinddir1/Xdir2', 'd') + call delete('Xfinddir1', 'd') endfunc " Test findfile({name} [, {path} [, {count}]]) @@ -34,7 +34,7 @@ func Test_findfile() let save_dir = getcwd() set shellslash call CreateFiles() - cd Xdir1 + cd Xfinddir1 e Xdir2/foo " With ,, in path, findfile() searches in current directory. @@ -83,34 +83,34 @@ func Test_findfile() " Test upwards search. cd Xdir2/Xdir3 call assert_equal('bar', findfile('bar', ';')) - call assert_match('.*/Xdir1/Xdir2/foo', findfile('foo', ';')) - call assert_match('.*/Xdir1/Xdir2/foo', findfile('foo', ';', 1)) - call assert_match('.*/Xdir1/foo', findfile('foo', ';', 2)) - call assert_match('.*/Xdir1/foo', findfile('foo', ';', 2)) - call assert_match('.*/Xdir1/Xdir2/foo', findfile('foo', 'Xdir2;', 1)) + call assert_match('.*/Xfinddir1/Xdir2/foo', findfile('foo', ';')) + call assert_match('.*/Xfinddir1/Xdir2/foo', findfile('foo', ';', 1)) + call assert_match('.*/Xfinddir1/foo', findfile('foo', ';', 2)) + call assert_match('.*/Xfinddir1/foo', findfile('foo', ';', 2)) + call assert_match('.*/Xfinddir1/Xdir2/foo', findfile('foo', 'Xdir2;', 1)) call assert_equal('', findfile('foo', 'Xdir2;', 2)) " List l should have at least 2 values (possibly more if foo file - " happens to be found upwards above Xdir1). + " happens to be found upwards above Xfinddir1). let l = findfile('foo', ';', -1) - call assert_match('.*/Xdir1/Xdir2/foo', l[0]) - call assert_match('.*/Xdir1/foo', l[1]) + call assert_match('.*/Xfinddir1/Xdir2/foo', l[0]) + call assert_match('.*/Xfinddir1/foo', l[1]) " Test upwards search with stop-directory. cd Xdir2 - let l = findfile('bar', ';' . save_dir . '/Xdir1/Xdir2/', -1) + let l = findfile('bar', ';' . save_dir . '/Xfinddir1/Xdir2/', -1) call assert_equal(1, len(l)) - call assert_match('.*/Xdir1/Xdir2/Xdir3/bar', l[0]) + call assert_match('.*/Xfinddir1/Xdir2/Xdir3/bar', l[0]) - let l = findfile('bar', ';' . save_dir . '/Xdir1/', -1) + let l = findfile('bar', ';' . save_dir . '/Xfinddir1/', -1) call assert_equal(2, len(l)) - call assert_match('.*/Xdir1/Xdir2/Xdir3/bar', l[0]) - call assert_match('.*/Xdir1/bar', l[1]) + call assert_match('.*/Xfinddir1/Xdir2/Xdir3/bar', l[0]) + call assert_match('.*/Xfinddir1/bar', l[1]) " Test combined downwards and upwards search from Xdir2/. cd ../.. call assert_equal('Xdir3/bar', findfile('bar', '**;', 1)) - call assert_match('.*/Xdir1/bar', findfile('bar', '**;', 2)) + call assert_match('.*/Xfinddir1/bar', findfile('bar', '**;', 2)) bwipe! call chdir(save_dir) @@ -134,7 +134,7 @@ func Test_finddir() let save_dir = getcwd() set path=,, call CreateFiles() - cd Xdir1 + cd Xfinddir1 call assert_equal('Xdir2', finddir('Xdir2')) call assert_equal('', 'Xdir3'->finddir()) @@ -157,17 +157,17 @@ func Test_finddir() " Test upwards dir search. cd Xdir2/Xdir3 - call assert_match('.*/Xdir1', finddir('Xdir1', ';')) + call assert_match('.*/Xfinddir1', finddir('Xfinddir1', ';')) " Test upwards search with stop-directory. - call assert_match('.*/Xdir1', finddir('Xdir1', ';' . save_dir . '/')) - call assert_equal('', finddir('Xdir1', ';' . save_dir . '/Xdir1/')) + call assert_match('.*/Xfinddir1', finddir('Xfinddir1', ';' . save_dir . '/')) + call assert_equal('', finddir('Xfinddir1', ';' . save_dir . '/Xfinddir1/')) " Test combined downwards and upwards dir search from Xdir2/. cd .. - call assert_match('.*/Xdir1', finddir('Xdir1', '**;', 1)) + call assert_match('.*/Xfinddir1', finddir('Xfinddir1', '**;', 1)) call assert_equal('Xdir3/Xdir2', finddir('Xdir2', '**;', 1)) - call assert_match('.*/Xdir1/Xdir2', finddir('Xdir2', '**;', 2)) + call assert_match('.*/Xfinddir1/Xdir2', finddir('Xdir2', '**;', 2)) call assert_equal('Xdir3', finddir('Xdir3', '**;', 1)) call chdir(save_dir) @@ -191,7 +191,7 @@ func Test_find_cmd() let save_dir = getcwd() set path=.,./**/* call CreateFiles() - cd Xdir1 + cd Xfinddir1 " Test for :find find foo
--- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -347,9 +347,9 @@ func Test_resolve_unix() call delete('Xlink2') call delete('Xlink3') - silent !ln -s -f Xdir//Xfile Xlink - call assert_equal('Xdir/Xfile', resolve('Xlink')) - call delete('Xlink') + silent !ln -s -f Xresolvedir//Xfile Xresolvelink + call assert_equal('Xresolvedir/Xfile', resolve('Xresolvelink')) + call delete('Xresolvelink') silent !ln -s -f Xlink2/ Xlink1 call assert_equal('Xlink2', 'Xlink1'->resolve()) @@ -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() . '\Xfile'), s:normalize_fname(resolve('./Xlink.lnk'))) + call assert_equal(s:normalize_fname(getcwd() . '\Xresfile'), s:normalize_fname(resolve('./Xlink.lnk'))) + call delete('Xresfile') + + 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' @@ -398,52 +398,51 @@ 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 Xslinkfile wq - call assert_equal('Xfile', resolve('Xfile')) - silent !mklink Xlink Xfile + call assert_equal('Xslinkfile', resolve('Xslinkfile')) + silent !mklink Xlink Xslinkfile if !v:shell_error - call assert_equal(s:normalize_fname(getcwd() . '\Xfile'), s:normalize_fname(resolve('./Xlink'))) + call assert_equal(s:normalize_fname(getcwd() . '\Xslinkfile'), s:normalize_fname(resolve('./Xlink'))) call delete('Xlink') else echomsg 'skipped test for symbolic link to a file' endif - call delete('Xfile') + call delete('Xslinkfile') " test for junction to a directory - call mkdir('Xdir') - silent !mklink /J Xlink Xdir + call mkdir('Xjuncdir') + silent !mklink /J Xlink Xjuncdir if !v:shell_error - call assert_equal(s:normalize_fname(getcwd() . '\Xdir'), s:normalize_fname(resolve(getcwd() . '/Xlink'))) - - call delete('Xdir', 'd') + call assert_equal(s:normalize_fname(getcwd() . '\Xjuncdir'), s:normalize_fname(resolve(getcwd() . '/Xlink'))) + + call delete('Xjuncdir', 'd') " test for junction already removed call assert_equal(s:normalize_fname(getcwd() . '\Xlink'), s:normalize_fname(resolve(getcwd() . '/Xlink'))) call delete('Xlink') else echomsg 'skipped test for junction to a directory' - call delete('Xdir', 'd') + call delete('Xjuncdir', 'd') endif " test for symbolic link to a directory - call mkdir('Xdir') - silent !mklink /D Xlink Xdir + call mkdir('Xjuncdir') + silent !mklink /D Xlink Xjuncdir if !v:shell_error - call assert_equal(s:normalize_fname(getcwd() . '\Xdir'), s:normalize_fname(resolve(getcwd() . '/Xlink'))) - - call delete('Xdir', 'd') + call assert_equal(s:normalize_fname(getcwd() . '\Xjuncdir'), s:normalize_fname(resolve(getcwd() . '/Xlink'))) + + call delete('Xjuncdir', 'd') " test for symbolic link already removed call assert_equal(s:normalize_fname(getcwd() . '\Xlink'), s:normalize_fname(resolve(getcwd() . '/Xlink'))) call delete('Xlink') else echomsg 'skipped test for symbolic link to a directory' - call delete('Xdir', 'd') + call delete('Xjuncdir', 'd') endif " test for buffer name @@ -461,20 +460,20 @@ func Test_resolve_win32() call delete('Xfile') " test for reparse point - call mkdir('Xdir') - call assert_equal('Xdir', resolve('Xdir')) - silent !mklink /D Xdirlink Xdir + call mkdir('Xparsedir') + call assert_equal('Xdir', resolve('Xparsedir')) + silent !mklink /D Xdirlink Xparsedir if !v:shell_error - w Xdir/text.txt - call assert_equal('Xdir/text.txt', resolve('Xdir/text.txt')) - call assert_equal(s:normalize_fname(getcwd() . '\Xdir\text.txt'), s:normalize_fname(resolve('Xdirlink\text.txt'))) - call assert_equal(s:normalize_fname(getcwd() . '\Xdir'), s:normalize_fname(resolve('Xdirlink'))) + w Xparsedir/text.txt + call assert_equal('Xparsedir/text.txt', resolve('Xparsedir/text.txt')) + call assert_equal(s:normalize_fname(getcwd() . '\Xparsedir\text.txt'), s:normalize_fname(resolve('Xdirlink\text.txt'))) + call assert_equal(s:normalize_fname(getcwd() . '\Xparsedir'), s:normalize_fname(resolve('Xdirlink'))) call delete('Xdirlink') else echomsg 'skipped test for reparse point' endif - call delete('Xdir', 'rf') + call delete('Xparsedir', 'rf') endfunc func Test_simplify() @@ -497,9 +496,9 @@ func Test_simplify() call assert_equal('./file', simplify('dir/.././file')) call assert_equal('../dir', simplify('./../dir')) call assert_equal('..', simplify('../testdir/..')) - call mkdir('Xdir') - call assert_equal('.', simplify('Xdir/../.')) - call delete('Xdir', 'd') + call mkdir('Xsimpdir') + call assert_equal('.', simplify('Xsimpdir/../.')) + call delete('Xsimpdir', 'd') call assert_fails('call simplify({->0})', 'E729:') call assert_fails('call simplify([])', 'E730:') @@ -1336,9 +1335,9 @@ func Test_filewritable() call assert_equal(0, filewritable('doesnotexist')) - call mkdir('Xdir') - call assert_equal(2, filewritable('Xdir')) - call delete('Xdir', 'd') + call mkdir('Xwritedir') + call assert_equal(2, filewritable('Xwritedir')) + call delete('Xwritedir', 'd') call delete('Xfilewritable') bw! @@ -1364,17 +1363,17 @@ func Test_Executable() bwipe " create "notepad.bat" - call mkdir('Xdir') - let notepadbat = fnamemodify('Xdir/notepad.bat', ':p') + call mkdir('Xnotedir') + let notepadbat = fnamemodify('Xnotedir/notepad.bat', ':p') call writefile([], notepadbat) new " check that the path and the pathext order is valid - lcd Xdir + lcd Xnotedir let [pathext, $PATHEXT] = [$PATHEXT, '.com;.exe;.bat;.cmd'] call assert_equal(notepadbat, exepath('notepad')) let $PATHEXT = pathext bwipe - eval 'Xdir'->delete('rf') + eval 'Xnotedir'->delete('rf') elseif has('unix') call assert_equal(1, 'cat'->executable()) call assert_equal(0, executable('nodogshere')) @@ -2073,88 +2072,88 @@ func Test_platform_name() endfunc func Test_readdir() - call mkdir('Xdir') - call writefile([], 'Xdir/foo.txt') - call writefile([], 'Xdir/bar.txt') - call mkdir('Xdir/dir') + call mkdir('Xreaddir') + call writefile([], 'Xreaddir/foo.txt') + call writefile([], 'Xreaddir/bar.txt') + call mkdir('Xreaddir/dir') " All results - let files = readdir('Xdir') + let files = readdir('Xreaddir') call assert_equal(['bar.txt', 'dir', 'foo.txt'], sort(files)) " Only results containing "f" - let files = 'Xdir'->readdir({ x -> stridx(x, 'f') != -1 }) + let files = 'Xreaddir'->readdir({ x -> stridx(x, 'f') != -1 }) call assert_equal(['foo.txt'], sort(files)) " Only .txt files - let files = readdir('Xdir', { x -> x =~ '.txt$' }) + let files = readdir('Xreaddir', { x -> x =~ '.txt$' }) call assert_equal(['bar.txt', 'foo.txt'], sort(files)) " Only .txt files with string - let files = readdir('Xdir', 'v:val =~ ".txt$"') + let files = readdir('Xreaddir', 'v:val =~ ".txt$"') call assert_equal(['bar.txt', 'foo.txt'], sort(files)) " Limit to 1 result. let l = [] - let files = readdir('Xdir', {x -> len(add(l, x)) == 2 ? -1 : 1}) + let files = readdir('Xreaddir', {x -> len(add(l, x)) == 2 ? -1 : 1}) call assert_equal(1, len(files)) " Nested readdir() must not crash - let files = readdir('Xdir', 'readdir("Xdir", "1") != []') + let files = readdir('Xreaddir', 'readdir("Xreaddir", "1") != []') call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt']) - eval 'Xdir'->delete('rf') + eval 'Xreaddir'->delete('rf') endfunc func Test_readdirex() - call mkdir('Xdir') - call writefile(['foo'], 'Xdir/foo.txt') - call writefile(['barbar'], 'Xdir/bar.txt') - call mkdir('Xdir/dir') + call mkdir('Xexdir') + call writefile(['foo'], 'Xexdir/foo.txt') + call writefile(['barbar'], 'Xexdir/bar.txt') + call mkdir('Xexdir/dir') " All results - let files = readdirex('Xdir')->map({-> v:val.name}) + let files = readdirex('Xexdir')->map({-> v:val.name}) call assert_equal(['bar.txt', 'dir', 'foo.txt'], sort(files)) - let sizes = readdirex('Xdir')->map({-> v:val.size}) + let sizes = readdirex('Xexdir')->map({-> v:val.size}) call assert_equal([0, 4, 7], sort(sizes)) " Only results containing "f" - let files = 'Xdir'->readdirex({ e -> stridx(e.name, 'f') != -1 }) + let files = 'Xexdir'->readdirex({ e -> stridx(e.name, 'f') != -1 }) \ ->map({-> v:val.name}) call assert_equal(['foo.txt'], sort(files)) " Only .txt files - let files = readdirex('Xdir', { e -> e.name =~ '.txt$' }) + let files = readdirex('Xexdir', { e -> e.name =~ '.txt$' }) \ ->map({-> v:val.name}) call assert_equal(['bar.txt', 'foo.txt'], sort(files)) " Only .txt files with string - let files = readdirex('Xdir', 'v:val.name =~ ".txt$"') + let files = readdirex('Xexdir', 'v:val.name =~ ".txt$"') \ ->map({-> v:val.name}) call assert_equal(['bar.txt', 'foo.txt'], sort(files)) " Limit to 1 result. let l = [] - let files = readdirex('Xdir', {e -> len(add(l, e.name)) == 2 ? -1 : 1}) + let files = readdirex('Xexdir', {e -> len(add(l, e.name)) == 2 ? -1 : 1}) \ ->map({-> v:val.name}) call assert_equal(1, len(files)) " Nested readdirex() must not crash - let files = readdirex('Xdir', 'readdirex("Xdir", "1") != []') + let files = readdirex('Xexdir', 'readdirex("Xexdir", "1") != []') \ ->map({-> v:val.name}) call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt']) " report broken link correctly if has("unix") - call writefile([], 'Xdir/abc.txt') - call system("ln -s Xdir/abc.txt Xdir/link") - call delete('Xdir/abc.txt') - let files = readdirex('Xdir', 'readdirex("Xdir", "1") != []') + call writefile([], 'Xexdir/abc.txt') + call system("ln -s Xexdir/abc.txt Xexdir/link") + call delete('Xexdir/abc.txt') + let files = readdirex('Xexdir', 'readdirex("Xexdir", "1") != []') \ ->map({-> v:val.name .. '_' .. v:val.type}) call sort(files)->assert_equal( \ ['bar.txt_file', 'dir_dir', 'foo.txt_file', 'link_link']) endif - eval 'Xdir'->delete('rf') + eval 'Xexdir'->delete('rf') call assert_fails('call readdirex("doesnotexist")', 'E484:') endfunc @@ -2166,34 +2165,34 @@ func Test_readdirex_sort() throw 'Skipped: Test_readdirex_sort on systems that do not allow this using the default filesystem' endif let _collate = v:collate - call mkdir('Xdir2') - call writefile(['1'], 'Xdir2/README.txt') - call writefile(['2'], 'Xdir2/Readme.txt') - call writefile(['3'], 'Xdir2/readme.txt') + call mkdir('Xsortdir2') + call writefile(['1'], 'Xsortdir2/README.txt') + call writefile(['2'], 'Xsortdir2/Readme.txt') + call writefile(['3'], 'Xsortdir2/readme.txt') " 1) default - let files = readdirex('Xdir2')->map({-> v:val.name}) + let files = readdirex('Xsortdir2')->map({-> v:val.name}) let default = copy(files) call assert_equal(['README.txt', 'Readme.txt', 'readme.txt'], files, 'sort using default') " 2) no sorting - let files = readdirex('Xdir2', 1, #{sort: 'none'})->map({-> v:val.name}) + let files = readdirex('Xsortdir2', 1, #{sort: 'none'})->map({-> v:val.name}) let unsorted = copy(files) call assert_equal(['README.txt', 'Readme.txt', 'readme.txt'], sort(files), 'unsorted') - call assert_fails("call readdirex('Xdir2', 1, #{slort: 'none'})", 'E857: Dictionary key "sort" required') + call assert_fails("call readdirex('Xsortdir2', 1, #{slort: 'none'})", 'E857: Dictionary key "sort" required') " 3) sort by case (same as default) - let files = readdirex('Xdir2', 1, #{sort: 'case'})->map({-> v:val.name}) + let files = readdirex('Xsortdir2', 1, #{sort: 'case'})->map({-> v:val.name}) call assert_equal(default, files, 'sort by case') " 4) sort by ignoring case - let files = readdirex('Xdir2', 1, #{sort: 'icase'})->map({-> v:val.name}) + let files = readdirex('Xsortdir2', 1, #{sort: 'icase'})->map({-> v:val.name}) call assert_equal(unsorted->sort('i'), files, 'sort by icase') " 5) Default Collation let collate = v:collate lang collate C - let files = readdirex('Xdir2', 1, #{sort: 'collate'})->map({-> v:val.name}) + let files = readdirex('Xsortdir2', 1, #{sort: 'collate'})->map({-> v:val.name}) call assert_equal(['README.txt', 'Readme.txt', 'readme.txt'], files, 'sort by C collation') " 6) Collation de_DE @@ -2201,20 +2200,20 @@ func Test_readdirex_sort() " available try lang collate de_DE - let files = readdirex('Xdir2', 1, #{sort: 'collate'})->map({-> v:val.name}) + let files = readdirex('Xsortdir2', 1, #{sort: 'collate'})->map({-> v:val.name}) call assert_equal(['readme.txt', 'Readme.txt', 'README.txt'], files, 'sort by de_DE collation') catch throw 'Skipped: de_DE collation is not available' finally exe 'lang collate' collate - eval 'Xdir2'->delete('rf') + eval 'Xsortdir2'->delete('rf') endtry endfunc func Test_readdir_sort() " some more cases for testing sorting for readdirex - let dir = 'Xdir3' + let dir = 'Xsortdir3' call mkdir(dir) call writefile(['1'], dir .. '/README.txt') call writefile(['2'], dir .. '/Readm.txt') @@ -2259,26 +2258,26 @@ func Test_readdir_sort() endfunc func Test_delete_rf() - call mkdir('Xdir') - call writefile([], 'Xdir/foo.txt') - call writefile([], 'Xdir/bar.txt') - call mkdir('Xdir/[a-1]') " issue #696 - call writefile([], 'Xdir/[a-1]/foo.txt') - call writefile([], 'Xdir/[a-1]/bar.txt') - call assert_true(filereadable('Xdir/foo.txt')) - call assert_true('Xdir/[a-1]/foo.txt'->filereadable()) - - call assert_equal(0, delete('Xdir', 'rf')) - call assert_false(filereadable('Xdir/foo.txt')) - call assert_false(filereadable('Xdir/[a-1]/foo.txt')) + call mkdir('Xrfdir') + call writefile([], 'Xrfdir/foo.txt') + call writefile([], 'Xrfdir/bar.txt') + call mkdir('Xrfdir/[a-1]') " issue #696 + call writefile([], 'Xrfdir/[a-1]/foo.txt') + call writefile([], 'Xrfdir/[a-1]/bar.txt') + call assert_true(filereadable('Xrfdir/foo.txt')) + call assert_true('Xrfdir/[a-1]/foo.txt'->filereadable()) + + call assert_equal(0, delete('Xrfdir', 'rf')) + call assert_false(filereadable('Xrfdir/foo.txt')) + call assert_false(filereadable('Xrfdir/[a-1]/foo.txt')) if has('unix') - call mkdir('Xdir/Xdir2', 'p') - silent !chmod 555 Xdir - call assert_equal(-1, delete('Xdir/Xdir2', 'rf')) - call assert_equal(-1, delete('Xdir', 'rf')) - silent !chmod 755 Xdir - call assert_equal(0, delete('Xdir', 'rf')) + call mkdir('Xrfdir/Xdir2', 'p') + silent !chmod 555 Xrfdir + call assert_equal(-1, delete('Xrfdir/Xdir2', 'rf')) + call assert_equal(-1, delete('Xrfdir', 'rf')) + silent !chmod 755 Xrfdir + call assert_equal(0, delete('Xrfdir', 'rf')) endif endfunc
--- a/src/testdir/test_getcwd.vim +++ b/src/testdir/test_getcwd.vim @@ -40,9 +40,9 @@ func SetUp() eval 'Xtopdir'->mkdir() cd Xtopdir let g:topdir = getcwd() - call mkdir('Xdir1') - call mkdir('Xdir2') - call mkdir('Xdir3') + call mkdir('Xcwdir1') + call mkdir('Xcwdir2') + call mkdir('Xcwdir3') endfunction let g:cwd=getcwd() @@ -57,23 +57,23 @@ function Test_GetCwd() new b new c 3wincmd w - lcd Xdir1 - call assert_equal("a Xdir1 1", GetCwdInfo(0, 0)) + lcd Xcwdir1 + call assert_equal("a Xcwdir1 1", GetCwdInfo(0, 0)) call assert_equal(g:topdir, getcwd(-1)) wincmd W call assert_equal("b Xtopdir 0", GetCwdInfo(0, 0)) call assert_equal(g:topdir, getcwd(-1)) wincmd W - lcd Xdir3 - call assert_equal("c Xdir3 1", GetCwdInfo(0, 0)) - call assert_equal("a Xdir1 1", GetCwdInfo(bufwinnr("a"), 0)) + lcd Xcwdir3 + call assert_equal("c Xcwdir3 1", GetCwdInfo(0, 0)) + call assert_equal("a Xcwdir1 1", GetCwdInfo(bufwinnr("a"), 0)) call assert_equal("b Xtopdir 0", GetCwdInfo(bufwinnr("b"), 0)) - call assert_equal("c Xdir3 1", GetCwdInfo(bufwinnr("c"), 0)) + call assert_equal("c Xcwdir3 1", GetCwdInfo(bufwinnr("c"), 0)) call assert_equal(g:topdir, getcwd(-1)) wincmd W - call assert_equal("a Xdir1 1", GetCwdInfo(bufwinnr("a"), tabpagenr())) + call assert_equal("a Xcwdir1 1", GetCwdInfo(bufwinnr("a"), tabpagenr())) call assert_equal("b Xtopdir 0", GetCwdInfo(bufwinnr("b"), tabpagenr())) - call assert_equal("c Xdir3 1", GetCwdInfo(bufwinnr("c"), tabpagenr())) + call assert_equal("c Xcwdir3 1", GetCwdInfo(bufwinnr("c"), tabpagenr())) call assert_equal(g:topdir, getcwd(-1)) tabnew x @@ -83,21 +83,21 @@ function Test_GetCwd() call assert_equal("x Xtopdir 0", GetCwdInfo(0, 0)) call assert_equal(g:topdir, getcwd(-1)) wincmd W - lcd Xdir2 - call assert_equal("y Xdir2 1", GetCwdInfo(0, 0)) + lcd Xcwdir2 + call assert_equal("y Xcwdir2 1", GetCwdInfo(0, 0)) call assert_equal(g:topdir, getcwd(-1)) wincmd W - lcd Xdir3 - call assert_equal("z Xdir3 1", GetCwdInfo(0, 0)) + lcd Xcwdir3 + call assert_equal("z Xcwdir3 1", GetCwdInfo(0, 0)) call assert_equal("x Xtopdir 0", GetCwdInfo(bufwinnr("x"), 0)) - call assert_equal("y Xdir2 1", GetCwdInfo(bufwinnr("y"), 0)) - call assert_equal("z Xdir3 1", GetCwdInfo(bufwinnr("z"), 0)) + call assert_equal("y Xcwdir2 1", GetCwdInfo(bufwinnr("y"), 0)) + call assert_equal("z Xcwdir3 1", GetCwdInfo(bufwinnr("z"), 0)) call assert_equal(g:topdir, getcwd(-1)) let tp_nr = tabpagenr() tabrewind call assert_equal("x Xtopdir 0", GetCwdInfo(3, tp_nr)) - call assert_equal("y Xdir2 1", GetCwdInfo(2, tp_nr)) - call assert_equal("z Xdir3 1", GetCwdInfo(1, tp_nr)) + call assert_equal("y Xcwdir2 1", GetCwdInfo(2, tp_nr)) + call assert_equal("z Xcwdir3 1", GetCwdInfo(1, tp_nr)) call assert_equal(g:topdir, getcwd(-1)) " Non existing windows and tab pages call assert_equal('', getcwd(100)) @@ -241,24 +241,24 @@ function Test_Tab_Local_Cwd() " Change the global directory for the first tab page tabrewind | 1wincmd w - cd ../Xdir1 - call assert_equal("a Xdir1 0", GetCwdInfo(1, 1)) - call assert_equal("b Xdir1 0", GetCwdInfo(2, 1)) + cd ../Xcwdir1 + call assert_equal("a Xcwdir1 0", GetCwdInfo(1, 1)) + call assert_equal("b Xcwdir1 0", GetCwdInfo(2, 1)) call assert_equal("m Xtabdir1 2", GetCwdInfo(1, 2)) call assert_equal("n Xwindir2 1", GetCwdInfo(2, 2)) " Change the global directory for the second tab page tabnext | 1wincmd w - cd ../Xdir3 - call assert_equal("m Xdir3 0", GetCwdInfo(1, 2)) + cd ../Xcwdir3 + call assert_equal("m Xcwdir3 0", GetCwdInfo(1, 2)) call assert_equal("n Xwindir2 1", GetCwdInfo(2, 2)) - call assert_equal("o Xdir3 0", GetCwdInfo(3, 2)) + call assert_equal("o Xcwdir3 0", GetCwdInfo(3, 2)) " Change the tab-local directory for the third tab page tabnext | 1wincmd w - cd ../Xdir1 - call assert_equal("x Xdir1 0", GetCwdInfo(1, 3)) - call assert_equal("y Xdir1 0", GetCwdInfo(2, 3)) + cd ../Xcwdir1 + call assert_equal("x Xcwdir1 0", GetCwdInfo(1, 3)) + call assert_equal("y Xcwdir1 0", GetCwdInfo(2, 3)) call assert_equal("z Xwindir3 1", GetCwdInfo(3, 3)) enew | only | tabonly
--- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -1400,36 +1400,36 @@ func Test_gui_drop_files() %argdelete " pressing shift when dropping files should change directory let save_cwd = getcwd() - call mkdir('Xdir1') - call writefile([], 'Xdir1/Xfile1') - call writefile([], 'Xdir1/Xfile2') - let d = #{files: ['Xdir1/Xfile1', 'Xdir1/Xfile2'], row: 1, col: 1, + call mkdir('Xdropdir1') + call writefile([], 'Xdropdir1/Xfile1') + call writefile([], 'Xdropdir1/Xfile2') + let d = #{files: ['Xdropdir1/Xfile1', 'Xdropdir1/Xfile2'], row: 1, col: 1, \ modifiers: 0x4} call test_gui_event('dropfiles', d) - call assert_equal('Xdir1', fnamemodify(getcwd(), ':t')) + call assert_equal('Xdropdir1', fnamemodify(getcwd(), ':t')) call assert_equal('Xfile1', @%) call chdir(save_cwd) " pressing shift when dropping directory and files should change directory - let d = #{files: ['Xdir1', 'Xdir1/Xfile2'], row: 1, col: 1, modifiers: 0x4} + let d = #{files: ['Xdropdir1', 'Xdropdir1/Xfile2'], row: 1, col: 1, modifiers: 0x4} call test_gui_event('dropfiles', d) - call assert_equal('Xdir1', fnamemodify(getcwd(), ':t')) - call assert_equal('Xdir1', fnamemodify(@%, ':t')) + call assert_equal('Xdropdir1', fnamemodify(getcwd(), ':t')) + call assert_equal('Xdropdir1', fnamemodify(@%, ':t')) call chdir(save_cwd) %bw! %argdelete " dropping a directory should edit it - let d = #{files: ['Xdir1'], row: 1, col: 1, modifiers: 0} + let d = #{files: ['Xdropdir1'], row: 1, col: 1, modifiers: 0} call test_gui_event('dropfiles', d) - call assert_equal('Xdir1', @%) + call assert_equal('Xdropdir1', @%) %bw! %argdelete " dropping only a directory name with Shift should ignore it - let d = #{files: ['Xdir1'], row: 1, col: 1, modifiers: 0x4} + let d = #{files: ['Xdropdir1'], row: 1, col: 1, modifiers: 0x4} call test_gui_event('dropfiles', d) call assert_equal('', @%) %bw! %argdelete - call delete('Xdir1', 'rf') + call delete('Xdropdir1', 'rf') " drop files in the command line. The GUI drop files adds the file names to " the low level input buffer. So need to use a cmdline map and feedkeys()
--- a/src/testdir/test_help.vim +++ b/src/testdir/test_help.vim @@ -129,30 +129,30 @@ endfunc " Test for the :helptags command " NOTE: if you run tests as root this will fail. Don't run tests as root! func Test_helptag_cmd() - call mkdir('Xdir/a/doc', 'p') + call mkdir('Xtagdir/a/doc', 'p') " No help file to process in the directory - call assert_fails('helptags Xdir', 'E151:') + call assert_fails('helptags Xtagdir', 'E151:') - call writefile([], 'Xdir/a/doc/sample.txt') + call writefile([], 'Xtagdir/a/doc/sample.txt') " Test for ++t argument - helptags ++t Xdir - call assert_equal(["help-tags\ttags\t1"], readfile('Xdir/tags')) - call delete('Xdir/tags') + helptags ++t Xtagdir + call assert_equal(["help-tags\ttags\t1"], readfile('Xtagdir/tags')) + call delete('Xtagdir/tags') " Test parsing tags call writefile(['*tag1*', 'Example: >', ' *notag*', 'Example end: *tag2*'], - \ 'Xdir/a/doc/sample.txt') - helptags Xdir + \ 'Xtagdir/a/doc/sample.txt') + helptags Xtagdir call assert_equal(["tag1\ta/doc/sample.txt\t/*tag1*", - \ "tag2\ta/doc/sample.txt\t/*tag2*"], readfile('Xdir/tags')) + \ "tag2\ta/doc/sample.txt\t/*tag2*"], readfile('Xtagdir/tags')) " Duplicate tags in the help file - call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xdir/a/doc/sample.txt') - call assert_fails('helptags Xdir', 'E154:') + call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xtagdir/a/doc/sample.txt') + call assert_fails('helptags Xtagdir', 'E154:') - call delete('Xdir', 'rf') + call delete('Xtagdir', 'rf') endfunc func Test_helptag_cmd_readonly() @@ -160,25 +160,25 @@ func Test_helptag_cmd_readonly() CheckNotRoot " Read-only tags file - call mkdir('Xdir/doc', 'p') - call writefile([''], 'Xdir/doc/tags') - call writefile([], 'Xdir/doc/sample.txt') - call setfperm('Xdir/doc/tags', 'r-xr--r--') - call assert_fails('helptags Xdir/doc', 'E152:', getfperm('Xdir/doc/tags')) + call mkdir('Xrodir/doc', 'p') + call writefile([''], 'Xrodir/doc/tags') + call writefile([], 'Xrodir/doc/sample.txt') + call setfperm('Xrodir/doc/tags', 'r-xr--r--') + call assert_fails('helptags Xrodir/doc', 'E152:', getfperm('Xrodir/doc/tags')) let rtp = &rtp - let &rtp = 'Xdir' + let &rtp = 'Xrodir' helptags ALL let &rtp = rtp - call delete('Xdir/doc/tags') + call delete('Xrodir/doc/tags') " No permission to read the help file - call mkdir('Xdir/b/doc', 'p') - call writefile([], 'Xdir/b/doc/sample.txt') - call setfperm('Xdir/b/doc/sample.txt', '-w-------') - call assert_fails('helptags Xdir', 'E153:', getfperm('Xdir/b/doc/sample.txt')) - call delete('Xdir', 'rf') + call mkdir('Xrodir/b/doc', 'p') + call writefile([], 'Xrodir/b/doc/sample.txt') + call setfperm('Xrodir/b/doc/sample.txt', '-w-------') + call assert_fails('helptags Xrodir', 'E153:', getfperm('Xrodir/b/doc/sample.txt')) + call delete('Xrodir', 'rf') endfunc " Test for setting the 'helpheight' option in the help window
--- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -9,8 +9,8 @@ func Test_ins_complete() edit test_ins_complete.vim " The files in the current directory interferes with the files " used by this test. So use a separate directory for the test. - call mkdir('Xdir') - cd Xdir + call mkdir('Xcpldir') + cd Xcpldir set ff=unix call writefile(["test11\t36Gepeto\t/Tag/", @@ -105,7 +105,7 @@ func Test_ins_complete() call delete('Xtestdata') set cpt& cot& def& tags& tagbsearch& hidden& cd .. - call delete('Xdir', 'rf') + call delete('Xcpldir', 'rf') endfunc func Test_ins_complete_invalid_byte() @@ -433,7 +433,7 @@ endfunc func Test_ins_completeslash() CheckMSWindows - call mkdir('Xdir') + call mkdir('Xcpldir') let orig_shellslash = &shellslash set cpt& new @@ -442,31 +442,31 @@ func Test_ins_completeslash() set completeslash= exe "normal oXd\<C-X>\<C-F>" - call assert_equal('Xdir\', getline('.')) + call assert_equal('Xcpldir\', getline('.')) set completeslash=backslash exe "normal oXd\<C-X>\<C-F>" - call assert_equal('Xdir\', getline('.')) + call assert_equal('Xcpldir\', getline('.')) set completeslash=slash exe "normal oXd\<C-X>\<C-F>" - call assert_equal('Xdir/', getline('.')) + call assert_equal('Xcpldir/', getline('.')) set shellslash set completeslash= exe "normal oXd\<C-X>\<C-F>" - call assert_equal('Xdir/', getline('.')) + call assert_equal('Xcpldir/', getline('.')) set completeslash=backslash exe "normal oXd\<C-X>\<C-F>" - call assert_equal('Xdir\', getline('.')) + call assert_equal('Xcpldir\', getline('.')) set completeslash=slash exe "normal oXd\<C-X>\<C-F>" - call assert_equal('Xdir/', getline('.')) + call assert_equal('Xcpldir/', getline('.')) %bw! - call delete('Xdir', 'rf') + call delete('Xcpldir', 'rf') set noshellslash set completeslash=slash
--- a/src/testdir/test_packadd.vim +++ b/src/testdir/test_packadd.vim @@ -3,7 +3,7 @@ source check.vim func SetUp() - let s:topdir = getcwd() . '/Xdir' + let s:topdir = getcwd() . '/Xppdir' exe 'set packpath=' . s:topdir let s:plugdir = s:topdir . '/pack/mine/opt/mytest' endfunc @@ -51,9 +51,9 @@ func Test_packadd() call assert_equal(77, g:plugin_also_works) call assert_equal(17, g:ftdetect_works) call assert_true(len(&rtp) > len(rtp)) - call assert_match('/testdir/Xdir/pack/mine/opt/mytest\($\|,\)', &rtp) + call assert_match('/testdir/Xppdir/pack/mine/opt/mytest\($\|,\)', &rtp) - let new_after = match(&rtp, '/testdir/Xdir/pack/mine/opt/mytest/after,') + let new_after = match(&rtp, '/testdir/Xppdir/pack/mine/opt/mytest/after,') let forwarded = substitute(first_after_entry, '\\', '[/\\\\]', 'g') let old_after = match(&rtp, ',' . forwarded . '\>') call assert_true(new_after > 0, 'rtp is ' . &rtp) @@ -67,7 +67,7 @@ func Test_packadd() " Check the path of 'myte' is added call assert_true(len(&rtp) > len(rtp)) - call assert_match('/testdir/Xdir/pack/mine/opt/myte\($\|,\)', &rtp) + call assert_match('/testdir/Xppdir/pack/mine/opt/myte\($\|,\)', &rtp) " Check exception call assert_fails("packadd directorynotfound", 'E919:') @@ -89,7 +89,7 @@ func Test_packadd_start() call assert_equal(24, g:plugin_works) call assert_true(len(&rtp) > len(rtp)) - call assert_match('/testdir/Xdir/pack/mine/start/other\($\|,\)', &rtp) + call assert_match('/testdir/Xppdir/pack/mine/start/other\($\|,\)', &rtp) endfunc func Test_packadd_noload() @@ -106,7 +106,7 @@ func Test_packadd_noload() packadd! mytest call assert_true(len(&rtp) > len(rtp)) - call assert_match('testdir/Xdir/pack/mine/opt/mytest\($\|,\)', &rtp) + call assert_match('testdir/Xppdir/pack/mine/opt/mytest\($\|,\)', &rtp) call assert_equal(0, g:plugin_works) " check the path is not added twice
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -4390,7 +4390,7 @@ func Xvimgrep_autocmd_cd(cchar) autocmd BufRead * silent cd %:p:h augroup END - 10Xvimgrep /vim/ Xdir/** + 10Xvimgrep /vim/ Xgrepdir/** let l = g:Xgetlist() call assert_equal('f1.txt', bufname(l[0].bufnr)) call assert_equal('f2.txt', fnamemodify(bufname(l[2].bufnr), ':t')) @@ -4403,14 +4403,14 @@ func Xvimgrep_autocmd_cd(cchar) endfunc func Test_vimgrep_autocmd_cd() - call mkdir('Xdir/a', 'p') - call mkdir('Xdir/b', 'p') - call writefile(['a_L1_vim', 'a_L2_vim'], 'Xdir/a/f1.txt') - call writefile(['b_L1_vim', 'b_L2_vim'], 'Xdir/b/f2.txt') + call mkdir('Xgrepdir/a', 'p') + call mkdir('Xgrepdir/b', 'p') + call writefile(['a_L1_vim', 'a_L2_vim'], 'Xgrepdir/a/f1.txt') + call writefile(['b_L1_vim', 'b_L2_vim'], 'Xgrepdir/b/f2.txt') call Xvimgrep_autocmd_cd('c') call Xvimgrep_autocmd_cd('l') %bwipe - call delete('Xdir', 'rf') + call delete('Xgrepdir', 'rf') endfunc " The following test used to crash Vim
--- a/src/testdir/test_startup.vim +++ b/src/testdir/test_startup.vim @@ -1064,13 +1064,13 @@ func Test_exrc() call writefile(v:errors, 'Xtestout') qall [CODE] - call mkdir('Xdir') - call writefile(['let exrc_found=37'], 'Xdir/.exrc') - call writefile(after, 'Xdir/Xafter') - let cmd = GetVimProg() . ' --not-a-term -S Xafter --cmd "cd Xdir" --cmd "set enc=utf8 exrc secure"' + call mkdir('Xrcdir') + call writefile(['let exrc_found=37'], 'Xrcdir/.exrc') + call writefile(after, 'Xrcdir/Xafter') + let cmd = GetVimProg() . ' --not-a-term -S Xafter --cmd "cd Xrcdir" --cmd "set enc=utf8 exrc secure"' exe "silent !" . cmd - call assert_equal([], readfile('Xdir/Xtestout')) - call delete('Xdir', 'rf') + call assert_equal([], readfile('Xrcdir/Xtestout')) + call delete('Xrcdir', 'rf') endfunc " Test for starting Vim with a non-terminal as input/output @@ -1125,10 +1125,10 @@ func Test_w_arg() " Test for failing to open the script output file. This test works only when " the language is English. if v:lang == "C" || v:lang =~ '^[Ee]n' - call mkdir("Xdir") - let m = system(GetVimCommand() .. " -w Xdir") - call assert_equal("Cannot open for script output: \"Xdir\"\n", m) - call delete("Xdir", 'rf') + call mkdir("Xargdir") + let m = system(GetVimCommand() .. " -w Xargdir") + call assert_equal("Cannot open for script output: \"Xargdir\"\n", m) + call delete("Xargdir", 'rf') endif " A number argument sets the 'window' option
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -630,12 +630,12 @@ func Test_terminal_cwd() CheckExecutable pwd let cmd = 'pwd' endif - call mkdir('Xdir') - let buf = term_start(cmd, {'cwd': 'Xdir'}) - call WaitForAssert({-> assert_equal('Xdir', fnamemodify(getline(1), ":t"))}) + call mkdir('Xtermdir') + let buf = term_start(cmd, {'cwd': 'Xtermdir'}) + call WaitForAssert({-> assert_equal('Xtermdir', fnamemodify(getline(1), ":t"))}) exe buf . 'bwipe' - call delete('Xdir', 'rf') + call delete('Xtermdir', 'rf') endfunc func Test_terminal_cwd_failure()
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -315,14 +315,14 @@ def s:ScriptFuncPush() enddef def Test_disassemble_push() - mkdir('Xdir/autoload', 'p') + mkdir('Xdisdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xdisdir' var lines =<< trim END vim9script END - writefile(lines, 'Xdir/autoload/autoscript.vim') + writefile(lines, 'Xdisdir/autoload/autoscript.vim') lines =<< trim END vim9script @@ -342,7 +342,7 @@ def Test_disassemble_push() END v9.CheckScriptSuccess(lines) - delete('Xdir', 'rf') + delete('Xdisdir', 'rf') &rtp = save_rtp enddef
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -41,7 +41,7 @@ def TestCompilingError() enddef def TestCompilingErrorInTry() - var dir = 'Xdir/autoload' + var dir = 'Xcompdir/autoload' mkdir(dir, 'p') var lines =<< trim END @@ -61,7 +61,7 @@ def TestCompilingErrorInTry() catch /nothing/ endtry END - lines[1] = 'set rtp=' .. getcwd() .. '/Xdir' + lines[1] = 'set rtp=' .. getcwd() .. '/Xcompdir' writefile(lines, 'XTest_compile_error') var buf = g:RunVimInTerminal('-S XTest_compile_error', {rows: 10, wait_for_ruler: 0}) @@ -71,7 +71,7 @@ def TestCompilingErrorInTry() # clean up g:StopVimInTerminal(buf) delete('XTest_compile_error') - delete('Xdir', 'rf') + delete('Xcompdir', 'rf') enddef def Test_comment_error() @@ -170,7 +170,7 @@ def Test_wrong_function_name() enddef def Test_autoload_name_mismatch() - var dir = 'Xdir/autoload' + var dir = 'Xnamedir/autoload' mkdir(dir, 'p') var lines =<< trim END @@ -183,18 +183,18 @@ def Test_autoload_name_mismatch() writefile(lines, dir .. '/script.vim') var save_rtp = &rtp - exe 'set rtp=' .. getcwd() .. '/Xdir' + exe 'set rtp=' .. getcwd() .. '/Xnamedir' lines =<< trim END call script#Function() END v9.CheckScriptFailure(lines, 'E117:', 1) &rtp = save_rtp - delete(dir, 'rf') + delete('Xnamdir', 'rf') enddef def Test_autoload_names() - var dir = 'Xdir/autoload' + var dir = 'Xandir/autoload' mkdir(dir, 'p') var lines =<< trim END @@ -206,7 +206,7 @@ def Test_autoload_names() writefile(lines, dir .. '/foobar.vim') var save_rtp = &rtp - exe 'set rtp=' .. getcwd() .. '/Xdir' + exe 'set rtp=' .. getcwd() .. '/Xandir' lines =<< trim END assert_equal('yes', foobar#function()) @@ -218,11 +218,11 @@ def Test_autoload_names() v9.CheckDefAndScriptSuccess(lines) &rtp = save_rtp - delete(dir, 'rf') + delete('Xandir', 'rf') enddef def Test_autoload_error_in_script() - var dir = 'Xdir/autoload' + var dir = 'Xaedir/autoload' mkdir(dir, 'p') var lines =<< trim END @@ -234,7 +234,7 @@ def Test_autoload_error_in_script() writefile(lines, dir .. '/scripterror.vim') var save_rtp = &rtp - exe 'set rtp=' .. getcwd() .. '/Xdir' + exe 'set rtp=' .. getcwd() .. '/Xaedir' g:called_function = 'no' # The error in the autoload script cannot be checked with assert_fails(), use @@ -264,7 +264,7 @@ def Test_autoload_error_in_script() assert_equal('yes', g:called_function) &rtp = save_rtp - delete(dir, 'rf') + delete('Xaedir', 'rf') enddef def s:CallRecursive(n: number): number
--- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -766,10 +766,10 @@ def Test_use_autoload_import_in_mapping( g:result = 49 enddef END - mkdir('Xdir/autoload', 'p') - writefile(lines, 'Xdir/autoload/XautoloadExport.vim') + mkdir('Ximpdir/autoload', 'p') + writefile(lines, 'Ximpdir/autoload/XautoloadExport.vim') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Ximpdir' lines =<< trim END vim9script @@ -786,7 +786,7 @@ def Test_use_autoload_import_in_mapping( unlet g:result delete('Xmapscript.vim') nunmap <F3> - delete('Xdir', 'rf') + delete('Ximpdir', 'rf') &rtp = save_rtp enddef @@ -838,9 +838,9 @@ def Test_use_import_with_funcref_in_comm enddef def Test_use_autoload_import_in_insert_completion() - mkdir('Xdir/autoload', 'p') + mkdir('Xinsdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xinsdir' var lines =<< trim END vim9script @@ -857,7 +857,7 @@ def Test_use_autoload_import_in_insert_c enddef g:completion_loaded = 'yes' END - writefile(lines, 'Xdir/autoload/completion.vim') + writefile(lines, 'Xinsdir/autoload/completion.vim') new lines =<< trim END @@ -874,22 +874,22 @@ def Test_use_autoload_import_in_insert_c set thesaurusfunc= bwipe! - delete('Xdir', 'rf') + delete('Xinsdir', 'rf') &rtp = save_rtp enddef def Test_use_autoload_import_partial_in_opfunc() - mkdir('Xdir/autoload', 'p') + mkdir('Xpartdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xpartdir' var lines =<< trim END vim9script - export def Opfunc(..._) + export def Opfunc1(..._) g:opfunc_called = 'yes' enddef END - writefile(lines, 'Xdir/autoload/opfunc.vim') + writefile(lines, 'Xpartdir/autoload/opfunc.vim') new lines =<< trim END @@ -897,7 +897,7 @@ def Test_use_autoload_import_partial_in_ import autoload 'opfunc.vim' nnoremap <expr> <F3> TheFunc() def TheFunc(): string - &operatorfunc = function('opfunc.Opfunc', [0]) + &operatorfunc = function('opfunc.Opfunc1', [0]) return 'g@' enddef feedkeys("\<F3>l", 'xt') @@ -907,23 +907,23 @@ def Test_use_autoload_import_partial_in_ set opfunc= bwipe! - delete('Xdir', 'rf') + delete('Xpartdir', 'rf') nunmap <F3> &rtp = save_rtp enddef def Test_set_opfunc_to_autoload_func_directly() - mkdir('Xdir/autoload', 'p') + mkdir('Xdirdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xdirdir' var lines =<< trim END vim9script - export def Opfunc(..._) + export def Opfunc2(..._) g:opfunc_called = 'yes' enddef END - writefile(lines, 'Xdir/autoload/opfunc.vim') + writefile(lines, 'Xdirdir/autoload/opfunc.vim') new lines =<< trim END @@ -931,7 +931,7 @@ def Test_set_opfunc_to_autoload_func_dir import autoload 'opfunc.vim' nnoremap <expr> <F3> TheFunc() def TheFunc(): string - &operatorfunc = opfunc.Opfunc + &operatorfunc = opfunc.Opfunc2 return 'g@' enddef feedkeys("\<F3>l", 'xt') @@ -941,15 +941,15 @@ def Test_set_opfunc_to_autoload_func_dir set opfunc= bwipe! - delete('Xdir', 'rf') + delete('Xdirdir', 'rf') nunmap <F3> &rtp = save_rtp enddef def Test_use_autoload_import_in_fold_expression() - mkdir('Xdir/autoload', 'p') + mkdir('Xfolddir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xfolddir' var lines =<< trim END vim9script @@ -961,7 +961,7 @@ def Test_use_autoload_import_in_fold_exp enddef g:fold_loaded = 'yes' END - writefile(lines, 'Xdir/autoload/fold.vim') + writefile(lines, 'Xfolddir/autoload/fold.vim') lines =<< trim END vim9script @@ -985,7 +985,7 @@ def Test_use_autoload_import_in_fold_exp set foldexpr= foldtext& foldmethod& debug= bwipe! - delete('Xdir', 'rf') + delete('Xfolddir', 'rf') &rtp = save_rtp enddef @@ -1200,7 +1200,7 @@ def Test_autoload_import_deleted() END v9.CheckScriptFailure(lines, 'E484:') - delete('Xdir', 'rf') + delete('Xa.vim') enddef func Test_import_in_diffexpr() @@ -1455,9 +1455,9 @@ def Run_Test_import_in_spellsuggest_expr enddef def Test_export_shadows_global_function() - mkdir('Xdir/autoload', 'p') + mkdir('Xglobdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xglobdir' var lines =<< trim END vim9script @@ -1465,7 +1465,7 @@ def Test_export_shadows_global_function( return 'Shadow()' enddef END - writefile(lines, 'Xdir/autoload/shadow.vim') + writefile(lines, 'Xglobdir/autoload/shadow.vim') lines =<< trim END vim9script @@ -1481,7 +1481,7 @@ def Test_export_shadows_global_function( delfunc g:Shadow bwipe! - delete('Xdir', 'rf') + delete('Xglobdir', 'rf') &rtp = save_rtp enddef @@ -2178,10 +2178,10 @@ def Test_vim9_autoload_full_name() enddef END - mkdir('Xdir/autoload', 'p') - writefile(lines, 'Xdir/autoload/some.vim') + mkdir('Xfulldir/autoload', 'p') + writefile(lines, 'Xfulldir/autoload/some.vim') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xfulldir' assert_equal('test', g:some#Gettest()) assert_equal('name', g:some#name) @@ -2198,17 +2198,17 @@ def Test_vim9_autoload_full_name() return 'other' enddef END - writefile(lines, 'Xdir/autoload/Other.vim') + writefile(lines, 'Xfulldir/autoload/Other.vim') assert_equal('other', g:Other#GetOther()) - delete('Xdir', 'rf') + delete('Xfulldir', 'rf') &rtp = save_rtp enddef def Test_vim9script_autoload() - mkdir('Xdir/autoload', 'p') + mkdir('Xaldir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xaldir' # when the path has "/autoload/" prefix is not needed var lines =<< trim END @@ -2232,7 +2232,7 @@ def Test_vim9script_autoload() export final fname = 'final' export const cname = 'const' END - writefile(lines, 'Xdir/autoload/prefixed.vim') + writefile(lines, 'Xaldir/autoload/prefixed.vim') g:prefixed_loaded = 0 g:expected_loaded = 0 @@ -2266,14 +2266,14 @@ def Test_vim9script_autoload() unlet g:prefixed_loaded unlet g:expected_loaded - delete('Xdir', 'rf') + delete('Xaldir', 'rf') &rtp = save_rtp enddef def Test_import_autoload_not_exported() - mkdir('Xdir/autoload', 'p') + mkdir('Xnimdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xnimdir' # error when using an item that is not exported from an autoload script var exportLines =<< trim END @@ -2283,7 +2283,7 @@ def Test_import_autoload_not_exported() echo 'nop' enddef END - writefile(exportLines, 'Xdir/autoload/notExport1.vim') + writefile(exportLines, 'Xnimdir/autoload/notExport1.vim') var lines =<< trim END vim9script @@ -2329,7 +2329,7 @@ def Test_import_autoload_not_exported() # using a :def function we use a different autoload script every time so that # the function is compiled without the script loaded - writefile(exportLines, 'Xdir/autoload/notExport2.vim') + writefile(exportLines, 'Xnimdir/autoload/notExport2.vim') lines =<< trim END vim9script import autoload 'notExport2.vim' @@ -2340,7 +2340,7 @@ def Test_import_autoload_not_exported() END v9.CheckScriptFailure(lines, 'E1048: Item not found in script: notExport2#notFound') - writefile(exportLines, 'Xdir/autoload/notExport3.vim') + writefile(exportLines, 'Xnimdir/autoload/notExport3.vim') lines =<< trim END vim9script import autoload 'notExport3.vim' @@ -2352,7 +2352,7 @@ def Test_import_autoload_not_exported() # don't get E1049 because it is too complicated to figure out v9.CheckScriptFailure(lines, 'E1048: Item not found in script: notExport3#notExported') - writefile(exportLines, 'Xdir/autoload/notExport4.vim') + writefile(exportLines, 'Xnimdir/autoload/notExport4.vim') lines =<< trim END vim9script import autoload 'notExport4.vim' @@ -2363,7 +2363,7 @@ def Test_import_autoload_not_exported() END v9.CheckScriptFailure(lines, 'E117: Unknown function: notExport4#NotFunc') - writefile(exportLines, 'Xdir/autoload/notExport5.vim') + writefile(exportLines, 'Xnimdir/autoload/notExport5.vim') lines =<< trim END vim9script import autoload 'notExport5.vim' @@ -2374,7 +2374,7 @@ def Test_import_autoload_not_exported() END v9.CheckScriptFailure(lines, 'E117: Unknown function: notExport5#NotExport') - writefile(exportLines, 'Xdir/autoload/notExport6.vim') + writefile(exportLines, 'Xnimdir/autoload/notExport6.vim') lines =<< trim END vim9script import autoload 'notExport6.vim' @@ -2385,7 +2385,7 @@ def Test_import_autoload_not_exported() END v9.CheckScriptFailure(lines, 'E117: Unknown function: notExport6#NotFunc') - writefile(exportLines, 'Xdir/autoload/notExport7.vim') + writefile(exportLines, 'Xnimdir/autoload/notExport7.vim') lines =<< trim END vim9script import autoload 'notExport7.vim' @@ -2396,14 +2396,14 @@ def Test_import_autoload_not_exported() END v9.CheckScriptFailure(lines, 'E117: Unknown function: notExport7#NotExport') - delete('Xdir', 'rf') + delete('Xnimdir', 'rf') &rtp = save_rtp enddef def Test_vim9script_autoload_call() - mkdir('Xdir/autoload', 'p') + mkdir('Xcalldir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xcalldir' var lines =<< trim END vim9script @@ -2416,7 +2416,7 @@ def Test_vim9script_autoload_call() g:result = 'other' enddef END - writefile(lines, 'Xdir/autoload/another.vim') + writefile(lines, 'Xcalldir/autoload/another.vim') lines =<< trim END vim9script @@ -2440,14 +2440,14 @@ def Test_vim9script_autoload_call() v9.CheckScriptSuccess(lines) unlet g:result - delete('Xdir', 'rf') + delete('Xcalldir', 'rf') &rtp = save_rtp enddef def Test_vim9script_noclear_autoload() - mkdir('Xdir/autoload', 'p') + mkdir('Xnocdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xnocdir' var lines =<< trim END vim9script @@ -2456,7 +2456,7 @@ def Test_vim9script_noclear_autoload() enddef g:double_loaded = 'yes' END - writefile(lines, 'Xdir/autoload/double.vim') + writefile(lines, 'Xnocdir/autoload/double.vim') lines =<< trim END vim9script noclear @@ -2482,12 +2482,12 @@ def Test_vim9script_noclear_autoload() unlet g:double_loaded unlet g:script_loaded unlet g:result - delete('Xdir', 'rf') + delete('Xnocdir', 'rf') &rtp = save_rtp enddef def Test_vim9script_autoload_duplicate() - mkdir('Xdir/autoload', 'p') + mkdir('Xdupdir/autoload', 'p') var lines =<< trim END vim9script @@ -2498,8 +2498,8 @@ def Test_vim9script_autoload_duplicate() def Func() enddef END - writefile(lines, 'Xdir/autoload/dupfunc.vim') - assert_fails('source Xdir/autoload/dupfunc.vim', 'E1073:') + writefile(lines, 'Xdupdir/autoload/dupfunc.vim') + assert_fails('source Xdupdir/autoload/dupfunc.vim', 'E1073:') lines =<< trim END vim9script @@ -2510,8 +2510,8 @@ def Test_vim9script_autoload_duplicate() export def Func() enddef END - writefile(lines, 'Xdir/autoload/dup2func.vim') - assert_fails('source Xdir/autoload/dup2func.vim', 'E1073:') + writefile(lines, 'Xdupdir/autoload/dup2func.vim') + assert_fails('source Xdupdir/autoload/dup2func.vim', 'E1073:') lines =<< trim END vim9script @@ -2521,8 +2521,8 @@ def Test_vim9script_autoload_duplicate() export var Func = 'asdf' END - writefile(lines, 'Xdir/autoload/dup3func.vim') - assert_fails('source Xdir/autoload/dup3func.vim', 'E1041: Redefining script item: "Func"') + writefile(lines, 'Xdupdir/autoload/dup3func.vim') + assert_fails('source Xdupdir/autoload/dup3func.vim', 'E1041: Redefining script item: "Func"') lines =<< trim END vim9script @@ -2532,8 +2532,8 @@ def Test_vim9script_autoload_duplicate() def Func() enddef END - writefile(lines, 'Xdir/autoload/dup4func.vim') - assert_fails('source Xdir/autoload/dup4func.vim', 'E707:') + writefile(lines, 'Xdupdir/autoload/dup4func.vim') + assert_fails('source Xdupdir/autoload/dup4func.vim', 'E707:') lines =<< trim END vim9script @@ -2543,8 +2543,8 @@ def Test_vim9script_autoload_duplicate() export def Func() enddef END - writefile(lines, 'Xdir/autoload/dup5func.vim') - assert_fails('source Xdir/autoload/dup5func.vim', 'E707:') + writefile(lines, 'Xdupdir/autoload/dup5func.vim') + assert_fails('source Xdupdir/autoload/dup5func.vim', 'E707:') lines =<< trim END vim9script @@ -2554,14 +2554,14 @@ def Test_vim9script_autoload_duplicate() var Func = 'asdf' END - writefile(lines, 'Xdir/autoload/dup6func.vim') - assert_fails('source Xdir/autoload/dup6func.vim', 'E1041: Redefining script item: "Func"') - - delete('Xdir', 'rf') + writefile(lines, 'Xdupdir/autoload/dup6func.vim') + assert_fails('source Xdupdir/autoload/dup6func.vim', 'E1041: Redefining script item: "Func"') + + delete('Xdupdir', 'rf') enddef def Test_autoload_missing_function_name() - mkdir('Xdir/autoload', 'p') + mkdir('Xmisdir/autoload', 'p') var lines =<< trim END vim9script @@ -2569,10 +2569,10 @@ def Test_autoload_missing_function_name( def loadme#() enddef END - writefile(lines, 'Xdir/autoload/loadme.vim') - assert_fails('source Xdir/autoload/loadme.vim', 'E129:') - - delete('Xdir', 'rf') + writefile(lines, 'Xmisdir/autoload/loadme.vim') + assert_fails('source Xmisdir/autoload/loadme.vim', 'E129:') + + delete('Xmisdir', 'rf') enddef def Test_autoload_name_wrong() @@ -2584,22 +2584,22 @@ def Test_autoload_name_wrong() v9.CheckScriptFailure(lines, 'E746:') delete('Xscriptname.vim') - mkdir('Xdir/autoload', 'p') + mkdir('Xwrodir/autoload', 'p') lines =<< trim END vim9script def somescript#Func() enddef END - writefile(lines, 'Xdir/autoload/somescript.vim') - assert_fails('source Xdir/autoload/somescript.vim', 'E1263:') - - delete('Xdir', 'rf') + writefile(lines, 'Xwrodir/autoload/somescript.vim') + assert_fails('source Xwrodir/autoload/somescript.vim', 'E1263:') + + delete('Xwrodir', 'rf') enddef def Test_import_autoload_postponed() - mkdir('Xdir/autoload', 'p') + mkdir('Xpostdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xpostdir' var lines =<< trim END vim9script @@ -2610,7 +2610,7 @@ def Test_import_autoload_postponed() return 'bla' enddef END - writefile(lines, 'Xdir/autoload/postponed.vim') + writefile(lines, 'Xpostdir/autoload/postponed.vim') lines =<< trim END vim9script @@ -2628,14 +2628,14 @@ def Test_import_autoload_postponed() assert_equal('true', g:loaded_postponed) unlet g:loaded_postponed - delete('Xdir', 'rf') + delete('Xpostdir', 'rf') &rtp = save_rtp enddef def Test_import_autoload_override() - mkdir('Xdir/autoload', 'p') + mkdir('Xoverdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xoverdir' test_override('autoload', 1) var lines =<< trim END @@ -2647,7 +2647,7 @@ def Test_import_autoload_override() return 'bla' enddef END - writefile(lines, 'Xdir/autoload/override.vim') + writefile(lines, 'Xoverdir/autoload/override.vim') lines =<< trim END vim9script @@ -2664,14 +2664,14 @@ def Test_import_autoload_override() test_override('autoload', 0) unlet g:loaded_override - delete('Xdir', 'rf') + delete('Xoverdir', 'rf') &rtp = save_rtp enddef def Test_autoload_mapping() - mkdir('Xdir/autoload', 'p') + mkdir('Xmapdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xmapdir' var lines =<< trim END vim9script @@ -2685,7 +2685,7 @@ def Test_autoload_mapping() g:doit_called = 'yes' enddef END - writefile(lines, 'Xdir/autoload/toggle.vim') + writefile(lines, 'Xmapdir/autoload/toggle.vim') lines =<< trim END vim9script @@ -2716,7 +2716,7 @@ def Test_autoload_mapping() nunmap yy unlet g:toggle_loaded unlet g:toggle_called - delete('Xdir', 'rf') + delete('Xmapdir', 'rf') &rtp = save_rtp enddef @@ -2774,9 +2774,9 @@ enddef " test disassembling an auto-loaded function starting with "debug" def Test_vim9_autoload_disass() - mkdir('Xdir/autoload', 'p') + mkdir('Xdasdir/autoload', 'p') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xdasdir' var lines =<< trim END vim9script @@ -2784,7 +2784,7 @@ def Test_vim9_autoload_disass() return 'debug' enddef END - writefile(lines, 'Xdir/autoload/debugit.vim') + writefile(lines, 'Xdasdir/autoload/debugit.vim') lines =<< trim END vim9script @@ -2792,7 +2792,7 @@ def Test_vim9_autoload_disass() return 'profile' enddef END - writefile(lines, 'Xdir/autoload/profileit.vim') + writefile(lines, 'Xdasdir/autoload/profileit.vim') lines =<< trim END vim9script @@ -2803,7 +2803,7 @@ def Test_vim9_autoload_disass() END v9.CheckScriptSuccess(lines) - delete('Xdir', 'rf') + delete('Xdasdir', 'rf') &rtp = save_rtp enddef @@ -2816,10 +2816,10 @@ def Test_vim9_aucmd_autoload() enddef END - mkdir('Xdir/autoload', 'p') - writefile(lines, 'Xdir/autoload/foo.vim') + mkdir('Xauldir/autoload', 'p') + writefile(lines, 'Xauldir/autoload/foo.vim') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xauldir' augroup test autocmd TextYankPost * call foo#Test() augroup END @@ -2829,7 +2829,7 @@ def Test_vim9_aucmd_autoload() augroup test autocmd! augroup END - delete('Xdir', 'rf') + delete('Xauldir', 'rf') &rtp = save_rtp enddef @@ -2842,10 +2842,10 @@ def Test_vim9_autoload_case_sensitive() enddef END - mkdir('Xdir/autoload', 'p') - writefile(lines, 'Xdir/autoload/CaseSensitive.vim') + mkdir('Xcasedir/autoload', 'p') + writefile(lines, 'Xcasedir/autoload/CaseSensitive.vim') var save_rtp = &rtp - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xcasedir' lines =<< trim END vim9script @@ -2863,7 +2863,7 @@ def Test_vim9_autoload_case_sensitive() v9.CheckScriptFailure(lines, 'E1262:') endif - delete('Xdir', 'rf') + delete('Xcasedir', 'rf') &rtp = save_rtp enddef
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -3586,13 +3586,13 @@ def Run_test_no_redraw_when_restoring_cp export def Func() enddef END - mkdir('Xdir/autoload', 'p') - writefile(lines, 'Xdir/autoload/script.vim') + mkdir('Xnordir/autoload', 'p') + writefile(lines, 'Xnordir/autoload/script.vim') lines =<< trim END vim9script set cpo+=M - exe 'set rtp^=' .. getcwd() .. '/Xdir' + exe 'set rtp^=' .. getcwd() .. '/Xnordir' au CmdlineEnter : ++once timer_start(0, (_) => script#Func()) setline(1, 'some text') END @@ -3605,7 +3605,7 @@ def Run_test_no_redraw_when_restoring_cp term_sendkeys(buf, "\<Esc>u") g:StopVimInTerminal(buf) delete('XTest_redraw_cpo') - delete('Xdir', 'rf') + delete('Xnordir', 'rf') enddef func Test_reject_declaration()
--- a/src/testdir/test_viminfo.vim +++ b/src/testdir/test_viminfo.vim @@ -962,10 +962,10 @@ func Test_viminfo_perm() call delete('Xviminfo') " Try to write the viminfo to a directory - call mkdir('Xdir') - call assert_fails('wviminfo Xdir', 'E137:') - call assert_fails('rviminfo Xdir', 'E195:') - call delete('Xdir', 'rf') + call mkdir('Xvifdir') + call assert_fails('wviminfo Xvifdir', 'E137:') + call assert_fails('rviminfo Xvifdir', 'E195:') + call delete('Xvifdir', 'rf') endfunc " Test for writing to an existing viminfo file merges the file marks
--- a/src/testdir/test_writefile.vim +++ b/src/testdir/test_writefile.vim @@ -251,9 +251,9 @@ func Test_write_errors() " Try to overwrite a directory if has('unix') - call mkdir('Xdir1') - call assert_fails('write Xdir1', 'E17:') - call delete('Xdir1', 'd') + call mkdir('Xwerdir1') + call assert_fails('write Xwerdir1', 'E17:') + call delete('Xwerdir1', 'd') endif " Test for :wall for a buffer with no name @@ -479,20 +479,20 @@ func Test_write_readonly_dir() " Root can do it too. CheckNotRoot - call mkdir('Xdir/') - call writefile(['one'], 'Xdir/Xfile1') - call setfperm('Xdir', 'r-xr--r--') + call mkdir('Xrodir/') + call writefile(['one'], 'Xrodir/Xfile1') + call setfperm('Xrodir', 'r-xr--r--') " try to create a new file in the directory - new Xdir/Xfile2 + new Xrodir/Xfile2 call setline(1, 'two') call assert_fails('write', 'E212:') " try to create a backup file in the directory - edit! Xdir/Xfile1 - set backupdir=./Xdir backupskip= + edit! Xrodir/Xfile1 + set backupdir=./Xrodir backupskip= set patchmode=.orig call assert_fails('write', 'E509:') - call setfperm('Xdir', 'rwxr--r--') - call delete('Xdir', 'rf') + call setfperm('Xrodir', 'rwxr--r--') + call delete('Xrodir', 'rf') set backupdir& backupskip& patchmode& endfunc