]> granicus.if.org Git - vim/commitdiff
patch 8.2.0163: test hangs on MS-Windows console v8.2.0163
authorBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 19:49:11 +0000 (20:49 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 19:49:11 +0000 (20:49 +0100)
Problem:    Test hangs on MS-Windows console.
Solution:   use feedkeys() instead of test_feedinput(). (Ken Takata)

src/testdir/test_functions.vim
src/testing.c
src/version.c

index c6088f33a66a85a0125fec958ef82300b087427a..595a96358d7d11ed7b6a78f69a10ce96edb307be 100644 (file)
@@ -1844,12 +1844,10 @@ func Test_range()
   call assert_equal(1, index(range(1, 5), 2))
 
   " inputlist()
-  call test_feedinput("1\<CR>")
-  call assert_equal(1, inputlist(range(10)))
-  call test_feedinput("1\<CR>")
-  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))\<CR>1\<CR>", 'x')
+  call assert_equal(1, result)
+  call feedkeys(":let result = inputlist(range(3, 10))\<CR>1\<CR>", '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)))
index 3ab9dcdc900a2f961114b79c9e11eacfdbd629d9..5dacf073b344525fe782b75836a0bfcae128a938 100644 (file)
@@ -640,6 +640,12 @@ f_test_feedinput(typval_T *argvars, typval_T *rettv UNUSED)
 #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();
index 7c5af637110ef5b7379a41f357aff072c8706811..46a71dbc34b636a91f0c67353befc812652cb11d 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    163,
 /**/
     162,
 /**/