Skip to content

Commit f33cae6

Browse files
committed
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.
1 parent 3777d6e commit f33cae6

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

src/testdir/test_swap.vim

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -502,27 +502,27 @@ endfunc
502502
" Test for renaming a buffer when the swap file is deleted out-of-band
503503
func Test_missing_swap_file()
504504
CheckUnix
505-
new Xfile1
505+
new Xfile2
506506
call delete(swapname(''))
507-
call assert_fails('file Xfile2', 'E301:')
508-
call assert_equal('Xfile2', bufname())
509-
call assert_true(bufexists('Xfile1'))
507+
call assert_fails('file Xfile3', 'E301:')
508+
call assert_equal('Xfile3', bufname())
510509
call assert_true(bufexists('Xfile2'))
510+
call assert_true(bufexists('Xfile3'))
511511
%bw!
512512
endfunc
513513

514514
" Test for :preserve command
515515
func Test_preserve()
516-
new Xfile1
516+
new Xfile4
517517
setlocal noswapfile
518518
call assert_fails('preserve', 'E313:')
519519
bw!
520520
endfunc
521521

522522
" Test for the v:swapchoice variable
523523
func Test_swapchoice()
524-
call writefile(['aaa', 'bbb'], 'Xfile1')
525-
edit Xfile1
524+
call writefile(['aaa', 'bbb'], 'Xfile5')
525+
edit Xfile5
526526
preserve
527527
let swapfname = swapname('')
528528
let b = readblob(swapfname)
@@ -536,7 +536,7 @@ func Test_swapchoice()
536536
autocmd!
537537
autocmd SwapExists * let v:swapchoice = 'o'
538538
augroup END
539-
edit Xfile1
539+
edit Xfile5
540540
call assert_true(&readonly)
541541
call assert_equal(['aaa', 'bbb'], getline(1, '$'))
542542
%bw!
@@ -548,11 +548,11 @@ func Test_swapchoice()
548548
autocmd SwapExists * let v:swapchoice = 'a'
549549
augroup END
550550
try
551-
edit Xfile1
551+
edit Xfile5
552552
catch /^Vim:Interrupt$/
553553
endtry
554554
call assert_equal('', @%)
555-
call assert_true(bufexists('Xfile1'))
555+
call assert_true(bufexists('Xfile5'))
556556
%bw!
557557
call assert_true(filereadable(swapfname))
558558

@@ -561,12 +561,12 @@ func Test_swapchoice()
561561
autocmd!
562562
autocmd SwapExists * let v:swapchoice = 'd'
563563
augroup END
564-
edit Xfile1
565-
call assert_equal('Xfile1', @%)
564+
edit Xfile5
565+
call assert_equal('Xfile5', @%)
566566
%bw!
567567
call assert_false(filereadable(swapfname))
568568

569-
call delete('Xfile1')
569+
call delete('Xfile5')
570570
call delete(swapfname)
571571
augroup test_swapchoice
572572
autocmd!

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3103,
758760
/**/
759761
3102,
760762
/**/

0 commit comments

Comments
 (0)