blob: 6eca8bc713b15568206615ad7b86241a6e15ad96 [file] [log] [blame]
Bram Moolenaar292eff02017-07-11 21:46:28 +02001" Test whether glob()/globpath() return correct results with certain escaped
2" characters.
3
4function SetUp()
5 " make sure glob() doesn't use the shell
6 set shell=doesnotexist
7 " consistent sorting of file names
8 set nofileignorecase
9endfunction
10
11function Test_glob()
12 call assert_equal("", glob('Xxx\{'))
13 call assert_equal("", glob('Xxx\$'))
14 w! Xxx{
15 w! Xxx\$
16 call assert_equal("Xxx{", glob('Xxx\{'))
17 call assert_equal("Xxx$", glob('Xxx\$'))
18endfunction
19
20function Test_globpath()
21 call assert_equal("sautest/autoload/Test104.vim\nsautest/autoload/footest.vim",
22 \ globpath('sautest/autoload', '*.vim'))
23 call assert_equal(['sautest/autoload/Test104.vim', 'sautest/autoload/footest.vim'],
24 \ globpath('sautest/autoload', '*.vim', 0, 1))
25endfunction