]> granicus.if.org Git - vim/commitdiff
patch 8.1.1677: tests get stuck when running into an existing swapfile v8.1.1677
authorBram Moolenaar <Bram@vim.org>
Sat, 13 Jul 2019 12:47:26 +0000 (14:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 13 Jul 2019 12:47:26 +0000 (14:47 +0200)
Problem:    Tests get stuck when running into an existing swapfile.
Solution:   Set v:swapchoice to "q" and report an error. (Daniel Hahler,
            closes #4644)

src/testdir/runtest.vim
src/version.c

index e120e7f23b58461f5cca2347cefc5847f768589c..436ef72f61394b1ed057013d5fe369e30baba476 100644 (file)
@@ -68,10 +68,14 @@ set encoding=utf-8
 let s:test_script_fname = expand('%')
 au! SwapExists * call HandleSwapExists()
 func HandleSwapExists()
-  " Only ignore finding a swap file for the test script (the user might be
+  " Ignore finding a swap file for the test script (the user might be
   " editing it and do ":make test_name") and the output file.
+  " Report finding another swap file and chose 'q' to avoid getting stuck.
   if expand('<afile>') == 'messages' || expand('<afile>') =~ s:test_script_fname
     let v:swapchoice = 'e'
+  else
+    call assert_report('Unexpected swap file: ' .. v:swapname)
+    let v:swapchoice = 'q'
   endif
 endfunc
 
index c4fee1c0f84354fe0d970bbc46ed8bb6fabd112f..ae0df813ee219ef03acd74fd457a9f2a9ecc4538 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1677,
 /**/
     1676,
 /**/