1" 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 26