1" Test whether glob()/globpath() return correct results with certain escaped
2" characters.
3
4source check.vim
5
6func SetUp()
7  " consistent sorting of file names
8  set nofileignorecase
9endfunction
10
11function Test_glob()
12  " This test fails on Windows because of the special characters in the
13  " filenames. Disable the test on non-Unix systems for now.
14  CheckUnix
15
16  " Execute these commands in the sandbox, so that using the shell fails.
17  " Setting 'shell' to an invalid name causes a memory leak.
18  sandbox call assert_equal("", glob('Xxx\{'))
19  sandbox call assert_equal("", 'Xxx\$'->glob())
20  w! Xxx\{
21  w! Xxx\$
22  sandbox call assert_equal("Xxx{", glob('Xxx\{'))
23  sandbox call assert_equal("Xxx$", glob('Xxx\$'))
24  call delete('Xxx{')
25  call delete('Xxx$')
26endfunction
27
28function Test_globpath()
29  sandbox call assert_equal("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim",
30        \ globpath('sautest/autoload', 'glob*.vim'))
31  sandbox call assert_equal(['sautest/autoload/globone.vim', 'sautest/autoload/globtwo.vim'],
32        \ 'glob*.vim'->globpath('sautest/autoload', 0, 1))
33endfunction
34
35" vim: shiftwidth=2 sts=2 expandtab
36