diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-17 20:30:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-17 20:30:44 +0200 |
commit | e17f8817a1713a1ef20257c777a483b7ab57a841 (patch) | |
tree | e0bff85634df736d2c6640d66546f1e36023c7fe /src/testdir/test_functions.vim | |
parent | 9bb3eb3e02a942fb71a4c1ce913f938d0ddf82d5 (diff) | |
download | vim-git-e17f8817a1713a1ef20257c777a483b7ab57a841.tar.gz |
patch 8.2.0995: insufficient testing for the readdir() sort optionv8.2.0995
Problem: Insufficient testing for the readdir() sort option.
Solution: Add a few more tests. (Christian Brabandt, closes #6278)
Diffstat (limited to 'src/testdir/test_functions.vim')
-rw-r--r-- | src/testdir/test_functions.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index d0686eff3..6e5409551 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -2014,6 +2014,25 @@ func Test_readdir_sort() let files = readdir(dir, '1', #{sort: 'icase'}) call assert_equal(default->sort('i'), files, 'sort by ignoring case') + " 4) collation + let collate = v:collate + lang collate C + let files = readdir(dir, 1, #{sort: 'collate'}) + call assert_equal(default->sort(), files, 'sort by C collation') + exe "lang collate" collate + + " 5) Errors + call assert_fails('call readdir(dir, 1, 1)', 'E715') + call assert_fails('call readdir(dir, 1, #{sorta: 1})') + call assert_fails('call readdirex(dir, 1, #{sorta: 1})') + + " 6) ignore other values in dict + let files = readdir(dir, '1', #{sort: 'c'}) + call assert_equal(default, files, 'sort using default2') + + " Cleanup + exe "lang collate" collate + eval dir->delete('rf') endfunc |