summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_functions.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-07-22 19:36:37 +0200
committerBram Moolenaar <Bram@vim.org>2018-07-22 19:36:37 +0200
commit947b39e761b8a95cc1bd37ad0c2c30552238809a (patch)
treed03ff9d4fc6682ceea715ad41a4797a32b2fb860 /src/testdir/test_functions.vim
parent578333b2ecdfef3109cb07a82c3aa08ad3dc5664 (diff)
patch 8.1.0204: inputlist() is not testedv8.1.0204
Problem: inputlist() is not tested. Solution: Add a test. (Dominique Pelle, closes #3240)
Diffstat (limited to 'src/testdir/test_functions.vim')
-rw-r--r--src/testdir/test_functions.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 5cfaaa0643..14181fb0a4 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -810,6 +810,17 @@ func Test_col()
bw!
endfunc
+func Test_inputlist()
+ call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>1\<cr>", 'tx')
+ call assert_equal(1, c)
+ call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>2\<cr>", 'tx')
+ call assert_equal(2, c)
+ call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>3\<cr>", 'tx')
+ call assert_equal(3, c)
+
+ call assert_fails('call inputlist("")', 'E686:')
+endfunc
+
func Test_balloon_show()
if has('balloon_eval')
" This won't do anything but must not crash either.