]> granicus.if.org Git - vim/commitdiff
patch 8.1.0204: inputlist() is not tested v8.1.0204
authorBram Moolenaar <Bram@vim.org>
Sun, 22 Jul 2018 17:36:37 +0000 (19:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 22 Jul 2018 17:36:37 +0000 (19:36 +0200)
Problem:    inputlist() is not tested.
Solution:   Add a test. (Dominique Pelle, closes #3240)

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

index 5cfaaa0643a8dac650219332a67dceaef8554ddb..14181fb0a45a6f555d46b0cd10215266e18467cb 100644 (file)
@@ -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.
index 66fabd95c7f90ab100c5d07a25d186e4d089bc0c..735ac0e9a08085f8e3f61f488640a7038d5af8c9 100644 (file)
@@ -793,6 +793,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    204,
 /**/
     203,
 /**/