robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

dundargoctest: move oldtests to test directory (#22536)af23d17388

master
1.1 KiB34 linesraw
1" Test whether glob()/globpath() return correct results with certain escaped
2" characters.
3
4func SetUp()
5  " consistent sorting of file names
6  set nofileignorecase
7endfunction
8
9function Test_glob()
10  if !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.
13    return
14  endif
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.
18  sandbox call assert_equal("", glob('Xxx\{'))
19  sandbox call assert_equal("", 'Xxx\$'->glob())
20  w! Xxx\{
21  " } to fix highlighting
22  w! Xxx\$
23  sandbox call assert_equal("Xxx{", glob('Xxx\{'))
24  sandbox call assert_equal("Xxx$", glob('Xxx\$'))
25  call delete('Xxx{')
26  call delete('Xxx$')
27endfunction
28
29function Test_globpath()
30  sandbox call assert_equal(expand("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim"),
31        \ globpath('sautest/autoload', 'glob*.vim'))
32  sandbox call assert_equal([expand('sautest/autoload/globone.vim'), expand('sautest/autoload/globtwo.vim')],
33        \ 'glob*.vim'->globpath('sautest/autoload', 0, 1))
34endfunction