diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-16 22:57:58 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-16 23:01:29 -0400 |
commit | 1d736a1ae2e5dfc0e47f221dd155058a5da92294 (patch) | |
tree | 17a0f0351b527d9342a00ff86e4da0c73f5dfe14 | |
parent | 96a555346b294130e0b4f64f55b00d3838cc922f (diff) | |
download | rneovim-1d736a1ae2e5dfc0e47f221dd155058a5da92294.tar.gz rneovim-1d736a1ae2e5dfc0e47f221dd155058a5da92294.tar.bz2 rneovim-1d736a1ae2e5dfc0e47f221dd155058a5da92294.zip |
vim-patch:8.2.0444: swap file test fails on some systems
Problem: Swap file test fails on some systems.
Solution: Preserve the swap file. Send NL terminated keys.
https://github.com/vim/vim/commit/d36ef573b2fad620824495f5423cb649cde55e03
Cherry-pick Test_swap_prompt_splitwin() from patch 8.2.0301.
-rw-r--r-- | src/nvim/testdir/test_swap.vim | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_swap.vim b/src/nvim/testdir/test_swap.vim index e072e9ed7f..f440569d66 100644 --- a/src/nvim/testdir/test_swap.vim +++ b/src/nvim/testdir/test_swap.vim @@ -1,5 +1,7 @@ " Tests for the swap feature +source check.vim + func s:swapname() return trim(execute('swapname')) endfunc @@ -305,3 +307,31 @@ func Test_swap_recover_ext() augroup END augroup! test_swap_recover_ext endfunc + +" Test for selecting 'q' in the attention prompt +func Test_swap_prompt_splitwin() + CheckRunVimInTerminal + + call writefile(['foo bar'], 'Xfile1') + edit Xfile1 + preserve " should help to make sure the swap file exists + + let buf = RunVimInTerminal('', {'rows': 20}) + call term_sendkeys(buf, ":set nomore\n") + call term_sendkeys(buf, ":set noruler\n") + call term_sendkeys(buf, ":split Xfile1\n") + call term_wait(buf) + call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))}) + call term_sendkeys(buf, "q") + call term_wait(buf) + call term_sendkeys(buf, ":\<CR>") + call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))}) + call term_sendkeys(buf, ":echomsg winnr('$')\<CR>") + call term_wait(buf) + call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))}) + call StopVimInTerminal(buf) + %bwipe! + call delete('Xfile1') +endfunc + +" vim: shiftwidth=2 sts=2 expandtab |