summaryrefslogtreecommitdiffstats
path: root/src/testdir/check.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-26 22:16:48 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-26 22:16:48 +0100
commit15c476023f3c5fb32eb1936c5eb5f0f5f413f3c7 (patch)
treebe750fc0469158a70a4908e8ac74779bfd9426c9 /src/testdir/check.vim
parentbea9023d4260349c130faf447aa8d4cbadeffab2 (diff)
patch 8.2.0459: cannot check if a function name is correctv8.2.0459
Problem: Cannot check if a function name is correct. Solution: Add "?funcname" to exists().
Diffstat (limited to 'src/testdir/check.vim')
-rw-r--r--src/testdir/check.vim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/testdir/check.vim b/src/testdir/check.vim
index d01dd81dd5..22c33c0ac7 100644
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -25,9 +25,12 @@ func CheckOption(name)
endif
endfunc
-" Command to check for the presence of a function.
+" Command to check for the presence of a built-in function.
command -nargs=1 CheckFunction call CheckFunction(<f-args>)
func CheckFunction(name)
+ if !exists('?' .. a:name)
+ throw 'Checking for non-existent function ' .. a:name
+ endif
if !exists('*' .. a:name)
throw 'Skipped: ' .. a:name .. ' function missing'
endif