mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.0947: readdirex() doesn't handle broken link properly
Problem: Readdirex() doesn't handle broken link properly. Solution: Small fixes to readdirex(). (Christian Brabandt, closes #6226, closes #6213)
This commit is contained in:
@@ -1912,6 +1912,16 @@ func Test_readdirex()
|
||||
\ ->map({-> v:val.name})
|
||||
call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt'])
|
||||
|
||||
" report brocken link correctly
|
||||
if has("unix")
|
||||
call writefile([], 'Xdir/abc.txt')
|
||||
call system("ln -s Xdir/abc.txt Xdir/link")
|
||||
call delete('Xdir/abc.txt')
|
||||
let files = readdirex('Xdir', 'readdirex("Xdir", "1") != []')
|
||||
\ ->map({-> v:val.name .. '_' .. v:val.type})
|
||||
call sort(files)->assert_equal(
|
||||
\ ['bar.txt_file', 'dir_dir', 'foo.txt_file', 'link_link'])
|
||||
endif
|
||||
eval 'Xdir'->delete('rf')
|
||||
endfunc
|
||||
|
||||
|
Reference in New Issue
Block a user