# HG changeset patch # User Bram Moolenaar # Date 1580241604 -3600 # Node ID b780229f5792ca19767783ce476d124a6e90f88d # Parent f3dd340940a6d21e2c1064d909fb0bb257db7174 patch 8.2.0163: test hangs on MS-Windows console Commit: https://github.com/vim/vim/commit/272ca95fc3d21ae1e2626a7aec38a6990e88ad6b Author: Bram Moolenaar Date: Tue Jan 28 20:49:11 2020 +0100 patch 8.2.0163: test hangs on MS-Windows console Problem: Test hangs on MS-Windows console. Solution: use feedkeys() instead of test_feedinput(). (Ken Takata) diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -1844,12 +1844,10 @@ func Test_range() call assert_equal(1, index(range(1, 5), 2)) " inputlist() - call test_feedinput("1\") - call assert_equal(1, inputlist(range(10))) - call test_feedinput("1\") - call assert_equal(1, inputlist(range(3, 10))) - - call assert_equal('[0,1,2,3]', json_encode(range(4))) + call feedkeys(":let result = inputlist(range(10))\1\", 'x') + call assert_equal(1, result) + call feedkeys(":let result = inputlist(range(3, 10))\1\", 'x') + call assert_equal(1, result) " insert() call assert_equal([42, 1, 2, 3, 4, 5], insert(range(1, 5), 42)) @@ -1862,6 +1860,9 @@ func Test_range() " join() call assert_equal('0 1 2 3 4', join(range(5))) + " json_encode() + call assert_equal('[0,1,2,3]', json_encode(range(4))) + " len() call assert_equal(0, len(range(0))) call assert_equal(2, len(range(2))) diff --git a/src/testing.c b/src/testing.c --- a/src/testing.c +++ b/src/testing.c @@ -640,6 +640,12 @@ f_test_feedinput(typval_T *argvars, typv #ifdef USE_INPUT_BUF char_u *val = tv_get_string_chk(&argvars[0]); +# ifdef VIMDLL + // this doesn't work in the console + if (!gui.in_use) + return; +# endif + if (val != NULL) { trash_input_buf(); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 163, +/**/ 162, /**/ 161,