mirror of
https://github.com/neovim/neovim.git
synced 2025-11-21 09:36:29 +00:00
vim-patch:partial: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.
3b0d70f4ff
This only includes test_cd.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -69,11 +69,11 @@ endfunc
|
|||||||
" Test for chdir()
|
" Test for chdir()
|
||||||
func Test_chdir_func()
|
func Test_chdir_func()
|
||||||
let topdir = getcwd()
|
let topdir = getcwd()
|
||||||
call mkdir('Xdir/y/z', 'p')
|
call mkdir('Xchdir/y/z', 'p')
|
||||||
|
|
||||||
" Create a few tabpages and windows with different directories
|
" Create a few tabpages and windows with different directories
|
||||||
new
|
new
|
||||||
cd Xdir
|
cd Xchdir
|
||||||
tabnew
|
tabnew
|
||||||
tcd y
|
tcd y
|
||||||
below new
|
below new
|
||||||
@@ -81,22 +81,22 @@ func Test_chdir_func()
|
|||||||
lcd z
|
lcd z
|
||||||
|
|
||||||
tabfirst
|
tabfirst
|
||||||
call assert_match('^\[global\] .*/Xdir$', trim(execute('verbose pwd')))
|
call assert_match('^\[global\] .*/Xchdir$', trim(execute('verbose pwd')))
|
||||||
call chdir('..')
|
call chdir('..')
|
||||||
call assert_equal('y', fnamemodify(getcwd(1, 2), ':t'))
|
call assert_equal('y', fnamemodify(getcwd(1, 2), ':t'))
|
||||||
call assert_equal('z', fnamemodify(3->getcwd(2), ':t'))
|
call assert_equal('z', fnamemodify(3->getcwd(2), ':t'))
|
||||||
tabnext | wincmd t
|
tabnext | wincmd t
|
||||||
call assert_match('^\[tabpage\] .*/y$', trim(execute('verbose pwd')))
|
call assert_match('^\[tabpage\] .*/y$', trim(execute('verbose pwd')))
|
||||||
eval '..'->chdir()
|
eval '..'->chdir()
|
||||||
call assert_equal('Xdir', fnamemodify(getcwd(1, 2), ':t'))
|
call assert_equal('Xchdir', fnamemodify(getcwd(1, 2), ':t'))
|
||||||
call assert_equal('Xdir', fnamemodify(getcwd(2, 2), ':t'))
|
call assert_equal('Xchdir', fnamemodify(getcwd(2, 2), ':t'))
|
||||||
call assert_equal('z', fnamemodify(getcwd(3, 2), ':t'))
|
call assert_equal('z', fnamemodify(getcwd(3, 2), ':t'))
|
||||||
call assert_equal('testdir', fnamemodify(getcwd(1, 1), ':t'))
|
call assert_equal('testdir', fnamemodify(getcwd(1, 1), ':t'))
|
||||||
3wincmd w
|
3wincmd w
|
||||||
call assert_match('^\[window\] .*/z$', trim(execute('verbose pwd')))
|
call assert_match('^\[window\] .*/z$', trim(execute('verbose pwd')))
|
||||||
call chdir('..')
|
call chdir('..')
|
||||||
call assert_equal('Xdir', fnamemodify(getcwd(1, 2), ':t'))
|
call assert_equal('Xchdir', fnamemodify(getcwd(1, 2), ':t'))
|
||||||
call assert_equal('Xdir', fnamemodify(getcwd(2, 2), ':t'))
|
call assert_equal('Xchdir', fnamemodify(getcwd(2, 2), ':t'))
|
||||||
call assert_equal('y', fnamemodify(getcwd(3, 2), ':t'))
|
call assert_equal('y', fnamemodify(getcwd(3, 2), ':t'))
|
||||||
call assert_equal('testdir', fnamemodify(getcwd(1, 1), ':t'))
|
call assert_equal('testdir', fnamemodify(getcwd(1, 1), ':t'))
|
||||||
|
|
||||||
@@ -110,20 +110,20 @@ func Test_chdir_func()
|
|||||||
|
|
||||||
only | tabonly
|
only | tabonly
|
||||||
call chdir(topdir)
|
call chdir(topdir)
|
||||||
call delete('Xdir', 'rf')
|
call delete('Xchdir', 'rf')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for changing to the previous directory '-'
|
" Test for changing to the previous directory '-'
|
||||||
func Test_prev_dir()
|
func Test_prev_dir()
|
||||||
let topdir = getcwd()
|
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
|
" Create a few tabpages and windows with different directories
|
||||||
new | only
|
new | only
|
||||||
tabnew | new
|
tabnew | new
|
||||||
tabnew
|
tabnew
|
||||||
tabfirst
|
tabfirst
|
||||||
cd Xdir
|
cd Xprevdir
|
||||||
tabnext | wincmd t
|
tabnext | wincmd t
|
||||||
tcd a
|
tcd a
|
||||||
wincmd w
|
wincmd w
|
||||||
@@ -143,7 +143,7 @@ func Test_prev_dir()
|
|||||||
|
|
||||||
" Check the directory of all the windows
|
" Check the directory of all the windows
|
||||||
tabfirst
|
tabfirst
|
||||||
call assert_equal('Xdir', fnamemodify(getcwd(), ':t'))
|
call assert_equal('Xprevdir', fnamemodify(getcwd(), ':t'))
|
||||||
tabnext | wincmd t
|
tabnext | wincmd t
|
||||||
call assert_equal('a', fnamemodify(getcwd(), ':t'))
|
call assert_equal('a', fnamemodify(getcwd(), ':t'))
|
||||||
wincmd w
|
wincmd w
|
||||||
@@ -163,7 +163,7 @@ func Test_prev_dir()
|
|||||||
|
|
||||||
" Check the directory of all the windows
|
" Check the directory of all the windows
|
||||||
tabfirst
|
tabfirst
|
||||||
call assert_equal('Xdir', fnamemodify(getcwd(), ':t'))
|
call assert_equal('Xprevdir', fnamemodify(getcwd(), ':t'))
|
||||||
tabnext | wincmd t
|
tabnext | wincmd t
|
||||||
call assert_equal('a', fnamemodify(getcwd(), ':t'))
|
call assert_equal('a', fnamemodify(getcwd(), ':t'))
|
||||||
wincmd w
|
wincmd w
|
||||||
@@ -173,7 +173,7 @@ func Test_prev_dir()
|
|||||||
|
|
||||||
only | tabonly
|
only | tabonly
|
||||||
call chdir(topdir)
|
call chdir(topdir)
|
||||||
call delete('Xdir', 'rf')
|
call delete('Xprevdir', 'rf')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_lcd_split()
|
func Test_lcd_split()
|
||||||
|
|||||||
Reference in New Issue
Block a user