diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/check.vim | 16 | ||||
-rw-r--r-- | test/old/testdir/test_functions.vim | 22 | ||||
-rw-r--r-- | test/old/testdir/test_messages.vim | 3 |
3 files changed, 40 insertions, 1 deletions
diff --git a/test/old/testdir/check.vim b/test/old/testdir/check.vim index af1a80250c..647e25b214 100644 --- a/test/old/testdir/check.vim +++ b/test/old/testdir/check.vim @@ -108,6 +108,22 @@ func CheckNotBSD() endif endfunc +" Command to check for not running on a MacOS +command CheckNotMac call CheckNotMac() +func CheckNotMac() + if has('mac') + throw 'Skipped: does not work on MacOS' + endif +endfunc + +" Command to check for not running on a MacOS M1 system. +command CheckNotMacM1 call CheckNotMacM1() +func CheckNotMacM1() + if has('mac') && system('uname -a') =~ '\<arm64\>' + throw 'Skipped: does not work on MacOS M1' + endif +endfunc + " Command to check that making screendumps is supported. " Caller must source screendump.vim command CheckScreendump call CheckScreendump() diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 3e1e5a4816..7b20f47f7a 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -3281,4 +3281,26 @@ func Test_fullcommand() call assert_equal('', fullcommand(10)) endfunc +" Test for glob() with shell special patterns +func Test_glob_extended_bash() + CheckExecutable bash + CheckNotMSWindows + CheckNotMac " The default version of bash is old on macOS. + + let _shell = &shell + set shell=bash + + call mkdir('Xtestglob/foo/bar/src', 'p') + call writefile([], 'Xtestglob/foo/bar/src/foo.sh') + call writefile([], 'Xtestglob/foo/bar/src/foo.h') + call writefile([], 'Xtestglob/foo/bar/src/foo.cpp') + + " Sort output of glob() otherwise we end up with different + " ordering depending on whether file system is case-sensitive. + let expected = ['Xtestglob/foo/bar/src/foo.cpp', 'Xtestglob/foo/bar/src/foo.h'] + call assert_equal(expected, sort(glob('Xtestglob/**/foo.{h,cpp}', 0, 1))) + call delete('Xtestglob', 'rf') + let &shell=_shell +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/test/old/testdir/test_messages.vim b/test/old/testdir/test_messages.vim index adafb6bd23..9a999d71a8 100644 --- a/test/old/testdir/test_messages.vim +++ b/test/old/testdir/test_messages.vim @@ -379,7 +379,8 @@ endfunc " Test verbose message before echo command func Test_echo_verbose_system() CheckRunVimInTerminal - CheckUnix + CheckUnix " needs the "seq" command + CheckNotMac " doesn't use /tmp let buf = RunVimInTerminal('', {'rows': 10}) call term_sendkeys(buf, ":4 verbose echo system('seq 20')\<CR>") |