mirror of
https://github.com/neovim/neovim.git
synced 2026-07-29 20:08:03 +00:00
vim-patch:8.2.1505: not all file read and writecode is tested
Problem: Not all file read and writecode is tested.
Solution: Add a few tests. (Dominique Pellé, closes vim/vim#6764)
1b04ce2d40
Cherry-pick Test_glob() from patch 8.2.0634.
This commit is contained in:
@@ -2015,6 +2015,25 @@ func Test_getmousepos()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for glob()
|
||||
func Test_glob()
|
||||
call assert_equal('', glob(v:_null_string))
|
||||
call assert_equal('', globpath(v:_null_string, v:_null_string))
|
||||
|
||||
call writefile([], 'Xglob1')
|
||||
call writefile([], 'XGLOB2')
|
||||
set wildignorecase
|
||||
" Sort output of glob() otherwise we end up with different
|
||||
" ordering depending on whether file system is case-sensitive.
|
||||
call assert_equal(['XGLOB2', 'Xglob1'], sort(glob('Xglob[12]', 0, 1)))
|
||||
set wildignorecase&
|
||||
|
||||
call delete('Xglob1')
|
||||
call delete('XGLOB2')
|
||||
|
||||
call assert_fails("call glob('*', 0, {})", 'E728:')
|
||||
endfunc
|
||||
|
||||
func HasDefault(msg = 'msg')
|
||||
return a:msg
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user