diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-13 14:47:26 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-13 14:47:26 +0200 |
commit | b073da8929ae0c03c403197197ed6b57f0f3d3be (patch) | |
tree | d13b49014c53f7f8c1d0b5bbc493b79ef0644a0b /src/testdir/runtest.vim | |
parent | 017c2699381be17131a02f051ecb812067289856 (diff) |
patch 8.1.1677: tests get stuck when running into an existing swapfilev8.1.1677
Problem: Tests get stuck when running into an existing swapfile.
Solution: Set v:swapchoice to "q" and report an error. (Daniel Hahler,
closes #4644)
Diffstat (limited to 'src/testdir/runtest.vim')
-rw-r--r-- | src/testdir/runtest.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index e120e7f23b..436ef72f61 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -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 |