From 3274477347c9f7d2466ee9f73691e01600b26fc0 Mon Sep 17 00:00:00 2001 From: ichizok Date: Thu, 7 Apr 2022 04:01:09 +0900 Subject: [PATCH] Add CheckNotMacVim command for tests --- src/testdir/check.vim | 8 ++++++++ src/testdir/test_clientserver.vim | 4 ++-- src/testdir/test_edit.vim | 4 ++-- src/testdir/test_startup.vim | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/testdir/check.vim b/src/testdir/check.vim index b8a23c9b31..c6b1ac314e 100644 --- a/src/testdir/check.vim +++ b/src/testdir/check.vim @@ -111,6 +111,14 @@ func CheckNotBSD() endif endfunc +" Command to check for not running on a MacVim. +command CheckNotMacVim call CheckNotMacVim() +func CheckNotMacVim() + if has('gui_macvim') + throw 'Skipped: does not work on MacVim' + endif +endfunc + " Command to check that making screendumps is supported. " Caller must source screendump.vim command CheckScreendump call CheckScreendump() diff --git a/src/testdir/test_clientserver.vim b/src/testdir/test_clientserver.vim index e0866aa7e9..8181aea599 100644 --- a/src/testdir/test_clientserver.vim +++ b/src/testdir/test_clientserver.vim @@ -9,10 +9,10 @@ endif CheckFeature clientserver -if has('gui_macvim') && !has('gui_running') +if has('gui_macvim') " MacVim currently doesn't support client_server for non-gui. " See https://github.com/macvim-dev/macvim/issues/657 - finish + CheckGui endif source shared.vim diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index 18e1544d89..437ae08db2 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -1209,8 +1209,8 @@ endfunc func Test_edit_MOUSE() " This is a simple test, since we not really using the mouse here - if (has("gui_macvim") && has("gui_running")) - return + if has("gui_macvim") + CheckNotGui endif CheckFeature mouse 10new diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim index c636864c15..74c06c4838 100644 --- a/src/testdir/test_startup.vim +++ b/src/testdir/test_startup.vim @@ -839,7 +839,7 @@ func Test_v_argv() let out = system(GetVimCommand() . ' -es -V1 -X arg1 --cmd "echo v:argv" --cmd q') let list = out->split("', '") if !has('gui_macvim') " MacVim doesn't always use 'vim' as the executable as it could be 'Vim' - call assert_match('vim', list[0]) + call assert_match('vim', list[0]) endif let idx = index(list, 'arg1') call assert_true(idx > 2)