0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.0427: it is not possible to check for a typo in a feature name

Problem:    It is not possible to check for a typo in a feature name.
Solution:   Add an extra argument to has().
This commit is contained in:
Bram Moolenaar
2020-03-22 16:17:14 +01:00
parent 9b9be007e7
commit 7929651e05
5 changed files with 1232 additions and 536 deletions

View File

@@ -20,6 +20,14 @@ func Test_00_bufexists()
call assert_equal(0, bufexists('Xfoo'))
endfunc
func Test_has()
call assert_equal(1, has('eval'))
call assert_equal(1, has('eval', 1))
call assert_equal(0, has('nonexistent'))
call assert_equal(0, has('nonexistent', 1))
endfunc
func Test_empty()
call assert_equal(1, empty(''))
call assert_equal(0, empty('a'))
@@ -1586,7 +1594,7 @@ func Test_confirm()
call assert_equal(2, a)
" confirm() should return 0 when pressing CTRL-C.
call feedkeys("\<C-c>", 'L')
call feedkeys("\<C-C>", 'L')
let a = confirm('Are you sure?', "&Yes\n&No")
call assert_equal(0, a)