Mercurial > vim
changeset 17356:4fe44a3b732f v8.1.1677
patch 8.1.1677: tests get stuck when running into an existing swapfile
commit https://github.com/vim/vim/commit/b073da8929ae0c03c403197197ed6b57f0f3d3be
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 13 14:47:26 2019 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 13 Jul 2019 15:00:05 +0200 |
parents | e426b24ee7ed |
children | 6ca0988117dd |
files | src/testdir/runtest.vim src/version.c |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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