Skip to content

Commit 3777d6e

Browse files
committed
patch 8.2.3102: test for crash fix does not fail without the fix
Problem: Test for crash fix does not fail without the fix. Solution: Adjust the test sequence. (closes #8506)
1 parent 26e88ec commit 3777d6e

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

src/testdir/test_swap.vim

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,18 +373,22 @@ func Test_swap_prompt_splitwin()
373373
call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))})
374374
call StopVimInTerminal(buf)
375375

376-
" This caused Vim to crash when typing "q".
377-
" TODO: it does not actually reproduce the crash.
378-
call writefile(['au BufAdd * set virtualedit=all'], 'Xvimrc')
379-
380-
let buf = RunVimInTerminal('-u Xvimrc Xfile1', {'rows': 20, 'wait_for_ruler': 0})
381-
call TermWait(buf)
382-
call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:', term_getline(buf, 20))})
376+
" This caused Vim to crash when typing "q" at the swap file prompt.
377+
let buf = RunVimInTerminal('-c "au bufadd * let foo_w = wincol()"', {'rows': 18})
378+
call term_sendkeys(buf, ":e Xfile1\<CR>")
379+
call WaitForAssert({-> assert_match('More', term_getline(buf, 18))})
380+
call term_sendkeys(buf, " ")
381+
call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:', term_getline(buf, 18))})
383382
call term_sendkeys(buf, "q")
383+
call TermWait(buf)
384+
" check that Vim is still running
385+
call term_sendkeys(buf, ":echo 'hello'\<CR>")
386+
call WaitForAssert({-> assert_match('^hello', term_getline(buf, 18))})
387+
call term_sendkeys(buf, ":%bwipe!\<CR>")
388+
call StopVimInTerminal(buf)
384389

385390
%bwipe!
386391
call delete('Xfile1')
387-
call delete('Xvimrc')
388392
endfunc
389393

390394
func Test_swap_symlink()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3102,
758760
/**/
759761
3101,
760762
/**/

0 commit comments

Comments
 (0)