aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/check.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/check.vim')
-rw-r--r--src/nvim/testdir/check.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim
index 7f6b7dcfec..24d3959f83 100644
--- a/src/nvim/testdir/check.vim
+++ b/src/nvim/testdir/check.vim
@@ -12,6 +12,9 @@ endfunc
" Command to check for the presence of a working option.
command -nargs=1 CheckOption call CheckOption(<f-args>)
func CheckOption(name)
+ if !exists('&' .. a:name)
+ throw 'Checking for non-existent option ' .. a:name
+ endif
if !exists('+' .. a:name)
throw 'Skipped: ' .. a:name .. ' option not supported'
endif
@@ -74,6 +77,14 @@ func CheckCanRunGui()
endif
endfunc
+" Command to check that we are using the GUI
+command CheckGui call CheckGui()
+func CheckGui()
+ if !has('gui_running')
+ throw 'Skipped: only works in the GUI'
+ endif
+endfunc
+
" Command to check that not currently using the GUI
command CheckNotGui call CheckNotGui()
func CheckNotGui()