mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch:9.0.0610: global interrupt test fails when run under valgrind (#21285)
Problem: Global interrupt test fails when run under valgrind.
Solution: Use TermWait().
859ea4bc76
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -91,6 +91,7 @@ endfunc
|
|||||||
" Test for interrupting :global using Ctrl-C
|
" Test for interrupting :global using Ctrl-C
|
||||||
func Test_interrupt_global()
|
func Test_interrupt_global()
|
||||||
CheckRunVimInTerminal
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
cnoremap ; <Cmd>sleep 10<CR>
|
cnoremap ; <Cmd>sleep 10<CR>
|
||||||
call setline(1, repeat(['foo'], 5))
|
call setline(1, repeat(['foo'], 5))
|
||||||
@@ -100,14 +101,14 @@ func Test_interrupt_global()
|
|||||||
|
|
||||||
call term_sendkeys(buf, ":g/foo/norm :\<C-V>;\<CR>")
|
call term_sendkeys(buf, ":g/foo/norm :\<C-V>;\<CR>")
|
||||||
" Wait for :sleep to start
|
" Wait for :sleep to start
|
||||||
call term_wait(buf)
|
call TermWait(buf, 100)
|
||||||
call term_sendkeys(buf, "\<C-C>")
|
call term_sendkeys(buf, "\<C-C>")
|
||||||
call WaitForAssert({-> assert_match('Interrupted', term_getline(buf, 6))}, 1000)
|
call WaitForAssert({-> assert_match('Interrupted', term_getline(buf, 6))}, 1000)
|
||||||
|
|
||||||
" Also test in Ex mode
|
" Also test in Ex mode
|
||||||
call term_sendkeys(buf, "gQg/foo/norm :\<C-V>;\<CR>")
|
call term_sendkeys(buf, "gQg/foo/norm :\<C-V>;\<CR>")
|
||||||
" Wait for :sleep to start
|
" Wait for :sleep to start
|
||||||
call term_wait(buf)
|
call TermWait(buf, 100)
|
||||||
call term_sendkeys(buf, "\<C-C>")
|
call term_sendkeys(buf, "\<C-C>")
|
||||||
call WaitForAssert({-> assert_match('Interrupted', term_getline(buf, 5))}, 1000)
|
call WaitForAssert({-> assert_match('Interrupted', term_getline(buf, 5))}, 1000)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user