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().
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index f904cc0..96d7f31 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -20,6 +20,14 @@
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 @@
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)