patch 9.0.0336: tests are flaky because of using a common file name
Problem: Tests are flaky because of using a common file name.
Solution: Rename files and directories to be more unique.
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index a568fb2..a2d2b5e 100644
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -424,7 +424,7 @@
" terminal.
func Test_autoindent_remove_indent()
CheckRunVimInTerminal
- let buf = RunVimInTerminal('-N Xfile', {'rows': 6, 'cols' : 20})
+ let buf = RunVimInTerminal('-N Xarifile', {'rows': 6, 'cols' : 20})
call TermWait(buf)
call term_sendkeys(buf, ":set autoindent\n")
" leaving insert mode in a new line with indent added by autoindent, should
@@ -442,8 +442,8 @@
call term_sendkeys(buf, ":w\n")
call TermWait(buf)
call StopVimInTerminal(buf)
- call assert_equal(["\tfoo", '', repeat('x', 20)], readfile('Xfile'))
- call delete('Xfile')
+ call assert_equal(["\tfoo", '', repeat('x', 20)], readfile('Xarifile'))
+ call delete('Xarifile')
endfunc
func Test_edit_CR()
@@ -1530,7 +1530,7 @@
let longfilename = longdirname . '/' . repeat('a', 255)
call writefile(['Totum', 'Table'], longfilename)
new
- exe "next Xfile " . longfilename
+ exe "next Xnofile " . longfilename
exe "normal iT\<C-N>"
bwipe!
@@ -1754,19 +1754,19 @@
" Test for editing a file using invalid file encoding
func Test_edit_invalid_encoding()
CheckEnglish
- call writefile([], 'Xfile')
+ call writefile([], 'Xinvfile')
redir => msg
- new ++enc=axbyc Xfile
+ new ++enc=axbyc Xinvfile
redir END
call assert_match('\[NOT converted\]', msg)
- call delete('Xfile')
+ call delete('Xinvfile')
close!
endfunc
" Test for the "charconvert" option
func Test_edit_charconvert()
CheckEnglish
- call writefile(['one', 'two'], 'Xfile')
+ call writefile(['one', 'two'], 'Xccfile')
" set 'charconvert' to a non-existing function
set charconvert=NonExitingFunc()
@@ -1774,7 +1774,7 @@
let caught_e117 = v:false
try
redir => msg
- edit ++enc=axbyc Xfile
+ edit ++enc=axbyc Xccfile
catch /E117:/
let caught_e117 = v:true
finally
@@ -1792,7 +1792,7 @@
set charconvert=Cconv1()
new
redir => msg
- edit ++enc=axbyc Xfile
+ edit ++enc=axbyc Xccfile
redir END
call assert_equal(['one', 'two'], getline(1, '$'))
call assert_match("can't read output of 'charconvert'", msg)
@@ -1807,10 +1807,10 @@
call writefile(data, v:fname_out)
endfunc
set charconvert=Cconv2()
- new Xfile
- write ++enc=ucase Xfile1
- call assert_equal(['ONE', 'TWO'], readfile('Xfile1'))
- call delete('Xfile1')
+ new Xccfile
+ write ++enc=ucase Xccfile1
+ call assert_equal(['ONE', 'TWO'], readfile('Xccfile1'))
+ call delete('Xccfile1')
close!
delfunc Cconv2
set charconvert&
@@ -1821,13 +1821,13 @@
endfunc
set charconvert=Cconv3()
new
- call assert_fails('edit ++enc=lcase Xfile', 'E202:')
+ call assert_fails('edit ++enc=lcase Xccfile', 'E202:')
call assert_equal([''], getline(1, '$'))
close!
delfunc Cconv3
set charconvert&
- call delete('Xfile')
+ call delete('Xccfile')
endfunc
" Test for editing a file without read permission
@@ -1835,17 +1835,17 @@
CheckUnix
CheckNotRoot
- call writefile(['one', 'two'], 'Xfile')
- call setfperm('Xfile', '-w-------')
+ call writefile(['one', 'two'], 'Xnrpfile')
+ call setfperm('Xnrpfile', '-w-------')
new
redir => msg
- edit Xfile
+ edit Xnrpfile
redir END
call assert_equal(1, &readonly)
call assert_equal([''], getline(1, '$'))
call assert_match('\[Permission Denied\]', msg)
close!
- call delete('Xfile')
+ call delete('Xnrpfile')
endfunc
" Using :edit without leaving 'insertmode' should not cause Insert mode to be