aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-02 21:03:40 +0800
committerGitHub <noreply@github.com>2023-01-02 21:03:40 +0800
commit5c6f2122ad65eb16786e7b4a7b0835b50f23f943 (patch)
treed2a31b4a063c1a668220ec472729c6b2f05647d2 /src
parent5322bf99e6d5247370d282d9013381bf98b5b832 (diff)
downloadrneovim-5c6f2122ad65eb16786e7b4a7b0835b50f23f943.tar.gz
rneovim-5c6f2122ad65eb16786e7b4a7b0835b50f23f943.tar.bz2
rneovim-5c6f2122ad65eb16786e7b4a7b0835b50f23f943.zip
vim-patch:9.0.1129: sporadic Test_range() failure (#21619)
Problem: Sporadic Test_range() failure. Solution: Clear typeahead. Move to a separate function. (issue vim/vim#22771) https://github.com/vim/vim/commit/7bdcba08bb5e4c39093cdedee187177d705c7cb9 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_functions.vim19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index f3594d3cdc..500c30c76b 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -1437,6 +1437,19 @@ func Test_inputlist()
call assert_fails('call inputlist("")', 'E686:')
endfunc
+func Test_range_inputlist()
+ " flush out any garbage left in the buffer
+ while getchar(0)
+ endwhile
+
+ 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)
+
+ unlet result
+endfunc
+
func Test_balloon_show()
CheckFeature balloon_eval
@@ -2165,12 +2178,6 @@ func Test_range()
call assert_equal(1, index(range(1, 5), 2))
call assert_fails("echo index([1, 2], 1, [])", 'E745:')
- " inputlist()
- 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))
call assert_equal([42, 1, 2, 3, 4, 5], insert(range(1, 5), 42, 0))