Bram Moolenaar | 292eff0 | 2017-07-11 21:46:28 +0200 | [diff] [blame^] | 1 | " Test whether glob()/globpath() return correct results with certain escaped |
| 2 | " characters. |
| 3 | |
| 4 | function SetUp() |
| 5 | " make sure glob() doesn't use the shell |
| 6 | set shell=doesnotexist |
| 7 | " consistent sorting of file names |
| 8 | set nofileignorecase |
| 9 | endfunction |
| 10 | |
| 11 | function 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\$')) |
| 18 | endfunction |
| 19 | |
| 20 | function 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)) |
| 25 | endfunction |