aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-03 07:24:54 +0800
committerGitHub <noreply@github.com>2023-10-03 07:24:54 +0800
commit1101cfeb349453bc7220e68695bf60a0f96f3069 (patch)
tree1c9d4f465db17ebfdff92f7ebbdb417c1af9e7c9 /test/old/testdir
parente634222daded1e232f310f2d843079572cac9b88 (diff)
downloadrneovim-1101cfeb349453bc7220e68695bf60a0f96f3069.tar.gz
rneovim-1101cfeb349453bc7220e68695bf60a0f96f3069.tar.bz2
rneovim-1101cfeb349453bc7220e68695bf60a0f96f3069.zip
vim-patch:9.0.1972: win32: missing '**' expansion test (#25476)
Problem: win32: missing '**' expansion test (after v9.0.1947) Solution: Add test for MS-Windows win32: Add "**" test Vim supports "**" on MS-Windows. However, it is not tested by `Test_glob_extended_bash`. Unlike Unix, it doesn't use 'shell' and doesn't support {,} expansion. So, I added as a separate test. related: vim/vim#13205 closes: vim/vim#13250 https://github.com/vim/vim/commit/4a1ad5556423dca5f5b7ee39f143579e67569ae1 Co-authored-by: Ken Takata <kentkt@csc.jp>
Diffstat (limited to 'test/old/testdir')
-rw-r--r--test/old/testdir/test_functions.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim
index 7b20f47f7a..b27b0be802 100644
--- a/test/old/testdir/test_functions.vim
+++ b/test/old/testdir/test_functions.vim
@@ -3303,4 +3303,22 @@ func Test_glob_extended_bash()
let &shell=_shell
endfunc
+" Test for glob() with extended patterns (MS-Windows)
+" Vim doesn't use 'shell' to expand wildcards on MS-Windows.
+" Unlike bash, it doesn't support {,} expansion.
+func Test_glob_extended_mswin()
+ CheckMSWindows
+
+ 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', 'Xtestglob/foo/bar/src/foo.sh']
+ call assert_equal(expected, sort(glob('Xtestglob/**/foo.*', 0, 1)))
+ call delete('Xtestglob', 'rf')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab