diff options
Diffstat (limited to 'test/old/testdir/test_functions.vim')
-rw-r--r-- | test/old/testdir/test_functions.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 3e1e5a4816..f3636f93dd 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -3281,4 +3281,23 @@ func Test_fullcommand() call assert_equal('', fullcommand(10)) endfunc +" Test for glob() with shell special patterns +func Test_glob_extended_bash() + CheckExecutable bash + 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 |