mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
feat(fs): add vim.fs.dir()
This function is modeled after the path.dir() function from Penlight and the luafilesystem module.
This commit is contained in:
@@ -52,4 +52,18 @@ describe('vim.fs', function()
|
||||
]], nvim_prog))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('dir()', function()
|
||||
it('works', function()
|
||||
eq(true, exec_lua([[
|
||||
local dir, nvim = ...
|
||||
for name, type in vim.fs.dir(dir) do
|
||||
if name == nvim and type == 'file' then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
]], nvim_dir, nvim_prog_basename))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user