mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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:
@@ -2014,6 +2014,25 @@ func Test_readdir_sort()
|
|||||||
let files = readdir(dir, '1', #{sort: 'icase'})
|
let files = readdir(dir, '1', #{sort: 'icase'})
|
||||||
call assert_equal(default->sort('i'), files, 'sort by ignoring case')
|
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')
|
eval dir->delete('rf')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
995,
|
||||||
/**/
|
/**/
|
||||||
994,
|
994,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user