diff src/testdir/test_functions.vim @ 19536:bab20768e1fd v8.2.0325

patch 8.2.0325: ex_getln.c code not covered by tests Commit: https://github.com/vim/vim/commit/578fe947e3ad0cc7313c798cf76cc43dbf9b4ea6 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 27 21:32:51 2020 +0100 patch 8.2.0325: ex_getln.c code not covered by tests Problem: Ex_getln.c code not covered by tests. Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5702)
author Bram Moolenaar <Bram@vim.org>
date Thu, 27 Feb 2020 21:45:04 +0100
parents 738a4fe2c8c5
children 9a9ca0e622c8
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -1162,6 +1162,19 @@ func Test_input_func()
         \ .. "\<C-A>\<CR>", 'xt')
   delfunc Tcomplete
   call assert_equal('item1 item2 item3', c)
+
+  call assert_fails("call input('F:', '', 'invalid')", 'E180:')
+  call assert_fails("call input('F:', '', [])", 'E730:')
+endfunc
+
+" Test for the inputdialog() function
+func Test_inputdialog()
+  CheckNotGui
+
+  call feedkeys(":let v=inputdialog('Q:', 'xx', 'yy')\<CR>\<CR>", 'xt')
+  call assert_equal('xx', v)
+  call feedkeys(":let v=inputdialog('Q:', 'xx', 'yy')\<CR>\<Esc>", 'xt')
+  call assert_equal('yy', v)
 endfunc
 
 " Test for inputlist()