aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-05 09:49:52 +0800
committerGitHub <noreply@github.com>2022-11-05 09:49:52 +0800
commit5e86cf6c13aa0a092286b42937e578c1886a3b85 (patch)
tree5c8bd2776e3cbac280c359f863ae1d1d59ced0d0 /src/nvim/testdir/test_functions.vim
parent19a487bc86482392eb50c61375d20e440e6e16b7 (diff)
parentb002499c1978c98cc4dfc3a3f2326997720d571a (diff)
downloadrneovim-5e86cf6c13aa0a092286b42937e578c1886a3b85.tar.gz
rneovim-5e86cf6c13aa0a092286b42937e578c1886a3b85.tar.bz2
rneovim-5e86cf6c13aa0a092286b42937e578c1886a3b85.zip
Merge pull request #20938 from zeertzjq/vim-8.2.0644
vim-patch:8.2.{0433,0644,0866,0958}: various tests
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index f6c16a366b..5718266dae 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -29,6 +29,8 @@ func Test_has()
call assert_equal(0, and(has('ttyout'), 0))
call assert_equal(1, has('multi_byte_encoding'))
endif
+ call assert_equal(1, has('vcon', 1))
+ call assert_equal(1, has('mouse_gpm_enabled', 1))
call assert_equal(0, has('nonexistent'))
call assert_equal(0, has('nonexistent', 1))
@@ -1331,12 +1333,15 @@ 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)
+ if has('gui_running')
+ call assert_fails('let v=inputdialog([], "xx")', 'E730:')
+ call assert_fails('let v=inputdialog("Q", [])', 'E730:')
+ else
+ 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)
+ endif
endfunc
" Test for inputlist()
@@ -1387,6 +1392,7 @@ func Test_balloon_show()
call balloon_show('hi!')
if !has('gui_running')
call balloon_show(range(3))
+ call balloon_show([])
endif
endfunc
@@ -2271,6 +2277,9 @@ func Test_range()
call assert_fails('let x=range(2, 8, 0)', 'E726:')
call assert_fails('let x=range(3, 1)', 'E727:')
call assert_fails('let x=range(1, 3, -2)', 'E727:')
+ call assert_fails('let x=range([])', 'E745:')
+ call assert_fails('let x=range(1, [])', 'E745:')
+ call assert_fails('let x=range(1, 4, [])', 'E745:')
endfunc
func Test_garbagecollect_now_fails()