diff options
Diffstat (limited to 'src')
25 files changed, 532 insertions, 531 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index a996c8ba55..e4b76dba57 100644 --- 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() diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim index c2217c944b..c82cefc277 100644 --- 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() diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index d299ee3e62..9f60bbc796 100644 --- 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 diff --git a/src/testdir/test_checkpath.vim b/src/testdir/test_checkpath.vim index f6a3bbce08..ddc3add4ad 100644 --- 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& diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index f349ae49ed..cad5f9b490 100644 --- 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 feedkeys(":e Xwildmenu/\<Tab>\<Down>\<Down>\<Down>\<C-B>\"\<CR>", 'xt') + call assert_equal('"e Xwildmenu/dir2/dir3/dir4/file4_1.txt', @:) - call delete('Xdir1', 'rf') + call delete('Xwildmenu', 'rf') set wildmenu& endfunc diff --git a/src/testdir/test_delete.vim b/src/testdir/test_delete.vim index 6b49f153c6..a8d94c3a16 100644 --- 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() diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index 7e18474745..a568fb2dc2 100644 --- 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 diff --git a/src/testdir/test_excmd.vim b/src/testdir/test_excmd.vim index 7b270ff6fb..52d41db601 100644 --- 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 diff --git a/src/testdir/test_findfile.vim b/src/testdir/test_findfile.vim index 017089eac4..0f9f9cb2c2 100644 --- 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 diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index d483b740f7..1547447f7b 100644 --- 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() . '\Xresfile'), s:normalize_fname(resolve('./Xlink.lnk'))) + call delete('Xresfile') |