Files
neovim/src/nvim/testdir/test_escaped_glob.vim
Daniel Hahler 53eb835e8f vim-patch:8.0.1326: largefile test fails on CI, glob test on MS-Windows
Problem:    Largefile test fails on CI, glob test on MS-Windows.
Solution:   Remove largefile test from list of all tests. Don't run
            Test_glob() on non-unix systems.  More cleanup. (Yegappan
            Lakshmanan, closes vim/vim#2354)
6e77df2d85
2018-09-08 16:43:27 +02:00

34 lines
1.0 KiB
VimL

" 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()
let slash = (!exists('+shellslash') || &shellslash) ? '/' : '\'
call assert_equal('sautest'.slash.'autoload'.slash.'footest.vim',
\ globpath('sautest/autoload', '*.vim'))
call assert_equal(['sautest'.slash.'autoload'.slash.'footest.vim'],
\ globpath('sautest/autoload', '*.vim', 0, 1))
endfunction