aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-17 23:02:10 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-17 23:02:26 +0800
commitacfc3d54c6fc5b22adab057962c493b059a91fe7 (patch)
treef7807dd7ebc6cb49afdccfc304fa36e1210344a1 /src
parentc1c2c7b3163490b5e4374ee370616ea2581d4fe1 (diff)
downloadrneovim-acfc3d54c6fc5b22adab057962c493b059a91fe7.tar.gz
rneovim-acfc3d54c6fc5b22adab057962c493b059a91fe7.tar.bz2
rneovim-acfc3d54c6fc5b22adab057962c493b059a91fe7.zip
vim-patch:8.2.3103: swap test may fail on some systems
Problem: Swap test may fail on some systems when jobs take longer to exit. Solution: Use different file names. https://github.com/vim/vim/commit/f33cae605064c8bdb908a8069d936f752572cd76 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_swap.vim26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/testdir/test_swap.vim b/src/nvim/testdir/test_swap.vim
index 024a3b02bc..cf46b4c5bd 100644
--- a/src/nvim/testdir/test_swap.vim
+++ b/src/nvim/testdir/test_swap.vim
@@ -504,18 +504,18 @@ endfunc
" Test for renaming a buffer when the swap file is deleted out-of-band
func Test_missing_swap_file()
CheckUnix
- new Xfile1
+ new Xfile2
call delete(swapname(''))
- call assert_fails('file Xfile2', 'E301:')
- call assert_equal('Xfile2', bufname())
- call assert_true(bufexists('Xfile1'))
+ call assert_fails('file Xfile3', 'E301:')
+ call assert_equal('Xfile3', bufname())
call assert_true(bufexists('Xfile2'))
+ call assert_true(bufexists('Xfile3'))
%bw!
endfunc
" Test for :preserve command
func Test_preserve()
- new Xfile1
+ new Xfile4
setlocal noswapfile
call assert_fails('preserve', 'E313:')
bw!
@@ -523,8 +523,8 @@ endfunc
" Test for the v:swapchoice variable
func Test_swapchoice()
- call writefile(['aaa', 'bbb'], 'Xfile1')
- edit Xfile1
+ call writefile(['aaa', 'bbb'], 'Xfile5')
+ edit Xfile5
preserve
let swapfname = swapname('')
let b = readblob(swapfname)
@@ -538,7 +538,7 @@ func Test_swapchoice()
autocmd!
autocmd SwapExists * let v:swapchoice = 'o'
augroup END
- edit Xfile1
+ edit Xfile5
call assert_true(&readonly)
call assert_equal(['aaa', 'bbb'], getline(1, '$'))
%bw!
@@ -550,11 +550,11 @@ func Test_swapchoice()
autocmd SwapExists * let v:swapchoice = 'a'
augroup END
try
- edit Xfile1
+ edit Xfile5
catch /^Vim:Interrupt$/
endtry
call assert_equal('', @%)
- call assert_true(bufexists('Xfile1'))
+ call assert_true(bufexists('Xfile5'))
%bw!
call assert_true(filereadable(swapfname))
@@ -563,12 +563,12 @@ func Test_swapchoice()
autocmd!
autocmd SwapExists * let v:swapchoice = 'd'
augroup END
- edit Xfile1
- call assert_equal('Xfile1', @%)
+ edit Xfile5
+ call assert_equal('Xfile5', @%)
%bw!
call assert_false(filereadable(swapfname))
- call delete('Xfile1')
+ call delete('Xfile5')
call delete(swapfname)
augroup test_swapchoice
autocmd!