# HG changeset patch # User Bram Moolenaar # Date 1668087004 -3600 # Node ID 220215b8a7c940a3a067d3c0b9ad4aee3e2f8aab # Parent f305c074b627b34c550dd07117a5ade49327eeb5 patch 9.0.0854: no proper test for what 9.0.0846 fixes Commit: https://github.com/vim/vim/commit/7265851b2b4e5a63c0a02a9057dee237502ee557 Author: zeertzjq Date: Thu Nov 10 13:21:34 2022 +0000 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 #11523) diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim --- a/src/testdir/test_assert.vim +++ b/src/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)) @@ -338,10 +341,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, "\") + call TermWait(buf, 100) + call assert_match('E471: Argument required', term_getline(buf, 6)) + + call StopVimInTerminal(buf) endfunc func Test_assert_beeps() diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 854, +/**/ 853, /**/ 852,