aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-05 12:54:55 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-05-05 19:43:13 +0800
commit49c3eb01ab53c4f6bb3f372590878d46ef0c163a (patch)
treebf023b76ecedfc50fc698940de873efc7fa148bd
parent49a2bb91170f49101fa67b0cf4cbfec5885edcf4 (diff)
downloadrneovim-49c3eb01ab53c4f6bb3f372590878d46ef0c163a.tar.gz
rneovim-49c3eb01ab53c4f6bb3f372590878d46ef0c163a.tar.bz2
rneovim-49c3eb01ab53c4f6bb3f372590878d46ef0c163a.zip
vim-patch:9.0.0854: no proper test for what 9.0.0846 fixes
Problem: No proper test for what 9.0.0846 fixes. Solution: Run test in a terminal so that the hit-enter prompt can show up. (closes vim/vim#11523) https://github.com/vim/vim/commit/7265851b2b4e5a63c0a02a9057dee237502ee557
-rw-r--r--test/old/testdir/test_assert.vim20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/old/testdir/test_assert.vim b/test/old/testdir/test_assert.vim
index e20084515e..087eea3bcf 100644
--- a/test/old/testdir/test_assert.vim
+++ b/test/old/testdir/test_assert.vim
@@ -1,5 +1,8 @@
" Test that the methods used for testing work.
+source check.vim
+source term_util.vim
+
func Test_assert_false()
call assert_equal(0, assert_false(0))
call assert_equal(0, assert_false(v:false))
@@ -327,10 +330,21 @@ func Test_assert_fails_in_try_block()
endtry
endfunc
+" Test that assert_fails() in a timer does not cause a hit-enter prompt.
+" Requires using a terminal, in regular tests the hit-enter prompt won't be
+" triggered.
func Test_assert_fails_in_timer()
- " should not cause a hit-enter prompt, which isn't actually checked here
- call timer_start(0, {-> assert_fails('call', 'E471:')})
- sleep 10m
+ CheckRunVimInTerminal
+
+ let buf = RunVimInTerminal('', {'rows': 6})
+ let cmd = ":call timer_start(0, {-> assert_fails('call', 'E471:')})"
+ call term_sendkeys(buf, cmd)
+ call WaitForAssert({-> assert_equal(cmd, term_getline(buf, 6))})
+ call term_sendkeys(buf, "\<CR>")
+ call TermWait(buf, 100)
+ call assert_match('E471: Argument required', term_getline(buf, 6))
+
+ call StopVimInTerminal(buf)
endfunc
func Test_assert_beeps()