aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-23 13:35:13 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-23 13:35:26 -0400
commitb4a5745e84296f40077d1b3173743c72f2c81549 (patch)
treea865b61ce62423b3685f7d1eccbaca544e43c678
parent3fac3cad75aa41352d5ec35d7c68ed127ff2f970 (diff)
downloadrneovim-b4a5745e84296f40077d1b3173743c72f2c81549.tar.gz
rneovim-b4a5745e84296f40077d1b3173743c72f2c81549.tar.bz2
rneovim-b4a5745e84296f40077d1b3173743c72f2c81549.zip
vim-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 vim/vim#4644) https://github.com/vim/vim/commit/b073da8929ae0c03c403197197ed6b57f0f3d3be
-rw-r--r--src/nvim/testdir/runtest.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index 67646cce14..12358ac6aa 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -65,10 +65,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