Skip to content

Commit b073da8

Browse files
committed
patch 8.1.1677: tests get stuck when running into an existing swapfile
Problem: Tests get stuck when running into an existing swapfile. Solution: Set v:swapchoice to "q" and report an error. (Daniel Hahler, closes #4644)
1 parent 017c269 commit b073da8

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/testdir/runtest.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ set encoding=utf-8
6868
let s:test_script_fname = expand('%')
6969
au! SwapExists * call HandleSwapExists()
7070
func HandleSwapExists()
71-
" Only ignore finding a swap file for the test script (the user might be
71+
" Ignore finding a swap file for the test script (the user might be
7272
" editing it and do ":make test_name") and the output file.
73+
" Report finding another swap file and chose 'q' to avoid getting stuck.
7374
if expand('<afile>') == 'messages' || expand('<afile>') =~ s:test_script_fname
7475
let v:swapchoice = 'e'
76+
else
77+
call assert_report('Unexpected swap file: ' .. v:swapname)
78+
let v:swapchoice = 'q'
7579
endif
7680
endfunc
7781

src/version.c

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

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1677,
780782
/**/
781783
1676,
782784
/**/

0 commit comments

Comments
 (0)