0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0995: insufficient testing for the readdir() sort option

Problem:    Insufficient testing for the readdir() sort option.
Solution:   Add a few more tests. (Christian Brabandt, closes #6278)
This commit is contained in:
Bram Moolenaar
2020-06-17 20:30:44 +02:00
parent 9bb3eb3e02
commit e17f8817a1
2 changed files with 21 additions and 0 deletions

View File

@@ -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

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
995,
/**/
994,
/**/