blob: b91c6e742493f9227294b57bb709d8f5bd3b713b [file] [log] [blame]
" Test whether glob()/globpath() return correct results with certain escaped
" characters.
function SetUp()
" make sure glob() doesn't use the shell
set shell=doesnotexist
" consistent sorting of file names
set nofileignorecase
endfunction
function Test_glob()
if !has('unix')
" This test fails on Windows because of the special characters in the
" filenames. Disable the test on non-Unix systems for now.
return
endif
call assert_equal("", glob('Xxx\{'))
call assert_equal("", glob('Xxx\$'))
w! Xxx{
w! Xxx\$
call assert_equal("Xxx{", glob('Xxx\{'))
call assert_equal("Xxx$", glob('Xxx\$'))
call delete('Xxx{')
call delete('Xxx$')
endfunction
function Test_globpath()
call assert_equal("sautest/autoload/Test104.vim\nsautest/autoload/footest.vim",
\ globpath('sautest/autoload', '*.vim'))
call assert_equal(['sautest/autoload/Test104.vim', 'sautest/autoload/footest.vim'],
\ globpath('sautest/autoload', '*.vim', 0, 1))
endfunction