aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-03 06:50:11 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-09-03 09:01:08 +0800
commit05b49ef975664ccdfea4e7b5a0fc09c8ed2cf11a (patch)
tree027519fb6db03139ca82b33256f5dd30fe9de0d7 /src/nvim/testdir/test_functions.vim
parent1ffd527c837fb2465c9659273bbe5447a1352db2 (diff)
downloadrneovim-05b49ef975664ccdfea4e7b5a0fc09c8ed2cf11a.tar.gz
rneovim-05b49ef975664ccdfea4e7b5a0fc09c8ed2cf11a.tar.bz2
rneovim-05b49ef975664ccdfea4e7b5a0fc09c8ed2cf11a.zip
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) https://github.com/vim/vim/commit/1b04ce2d400fda97410a961288c496bd8f445a9c Cherry-pick Test_glob() from patch 8.2.0634.
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 147eda5b0a..99ac6ae32c 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -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