comparison src/testdir/test_swap.vim @ 19776:42e4083429a7

patch 8.2.0444: swap file test fails on some systems Commit: https://github.com/vim/vim/commit/d36ef573b2fad620824495f5423cb649cde55e03 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 24 21:44:51 2020 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Tue, 24 Mar 2020 21:45:05 +0100
parents 0aba9ef12488
children c087099e9163
comparison
equal deleted inserted replaced
19775:56dca79644a9 19776:42e4083429a7
1 " Tests for the swap feature 1 " Tests for the swap feature
2 2
3 source check.vim
3 source shared.vim 4 source shared.vim
4 source term_util.vim 5 source term_util.vim
5 6
6 func s:swapname() 7 func s:swapname()
7 return trim(execute('swapname')) 8 return trim(execute('swapname'))
350 augroup! test_swap_splitwin 351 augroup! test_swap_splitwin
351 endfunc 352 endfunc
352 353
353 " Test for selecting 'q' in the attention prompt 354 " Test for selecting 'q' in the attention prompt
354 func Test_swap_prompt_splitwin() 355 func Test_swap_prompt_splitwin()
355 if !CanRunVimInTerminal() 356 CheckRunVimInTerminal
356 throw 'Skipped: cannot run vim in terminal' 357
357 endif
358 call writefile(['foo bar'], 'Xfile1') 358 call writefile(['foo bar'], 'Xfile1')
359 edit Xfile1 359 edit Xfile1
360 preserve " should help to make sure the swap file exists
361
360 let buf = RunVimInTerminal('', {'rows': 20}) 362 let buf = RunVimInTerminal('', {'rows': 20})
361 call term_sendkeys(buf, ":set nomore\n") 363 call term_sendkeys(buf, ":set nomore\n")
362 call term_sendkeys(buf, ":set noruler\n") 364 call term_sendkeys(buf, ":set noruler\n")
363 call term_sendkeys(buf, ":split Xfile1\n") 365 call term_sendkeys(buf, ":split Xfile1\n")
364 call term_wait(buf) 366 call term_wait(buf)
365 call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))}) 367 call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))})
366 call term_sendkeys(buf, "q") 368 call term_sendkeys(buf, "q")
367 call term_wait(buf) 369 call term_wait(buf)
368 call term_sendkeys(buf, ":") 370 call term_sendkeys(buf, ":\<CR>")
369 call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))}) 371 call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))})
370 call term_sendkeys(buf, "echomsg winnr('$')\<CR>") 372 call term_sendkeys(buf, ":echomsg winnr('$')\<CR>")
371 call term_wait(buf) 373 call term_wait(buf)
372 call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))}) 374 call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))})
373 call StopVimInTerminal(buf) 375 call StopVimInTerminal(buf)
374 %bwipe! 376 %bwipe!
375 call delete('Xfile1') 377 call delete('Xfile1')