robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
af23d17388
master
1" Test whether glob()/globpath() return correct results with certain escaped 2" characters. 3 4func SetUp () 5" consistent sorting of file names 6set nofileignorecase 7endfunction 8 9function Test_glob () 10if ! has ( 'unix' ) 11" This test fails on Windows because of the special characters in the 12" filenames. Disable the test on non-Unix systems for now. 13return 14endif 15 16" Execute these commands in the sandbox, so that using the shell fails. 17" Setting 'shell' to an invalid name causes a memory leak. 18sandbox call assert_equal("", glob('Xxx\{')) 19sandbox call assert_equal("",'Xxx\$' ->glob()) 20w ! Xxx\{ 21" } to fix highlighting 22w ! Xxx\$ 23sandbox call assert_equal("Xxx{", glob('Xxx\{')) 24sandbox call assert_equal("Xxx$", glob('Xxx\$')) 25call delete ( 'Xxx{' ) 26call delete ( 'Xxx$' ) 27endfunction 28 29function Test_globpath () 30sandbox call assert_equal(expand("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim"), 31 \ globpath('sautest/autoload','glob*.vim' )) 32sandbox call assert_equal([expand('sautest/autoload/globone.vim'), expand('sautest/autoload/globtwo.vim')], 33 \'glob*.vim' ->globpath('sautest/autoload', 0, 1)) 34endfunction