diff options
author | Gregory Anders <greg@gpanders.com> | 2022-05-15 20:37:35 -0600 |
---|---|---|
committer | Gregory Anders <greg@gpanders.com> | 2022-05-31 13:04:41 -0600 |
commit | f271d706611049bc53a6a439b310fe60bf0fab13 (patch) | |
tree | e02db4304f800e9ee9f3750edda5bf31b64e1f51 /test/functional/lua/fs_spec.lua | |
parent | 2a62bec37ced51678ff914700d7165605d5a0d53 (diff) | |
download | rneovim-f271d706611049bc53a6a439b310fe60bf0fab13.tar.gz rneovim-f271d706611049bc53a6a439b310fe60bf0fab13.tar.bz2 rneovim-f271d706611049bc53a6a439b310fe60bf0fab13.zip |
feat(fs): add vim.fs.find()
This is a pure Lua implementation of the Vim findfile() and finddir()
functions without the special syntax.
Diffstat (limited to 'test/functional/lua/fs_spec.lua')
-rw-r--r-- | test/functional/lua/fs_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index 6f1f1df012..204bdc1567 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -66,4 +66,17 @@ describe('vim.fs', function() ]], nvim_dir, nvim_prog_basename)) end) end) + + describe('find()', function() + it('works', function() + eq({test_build_dir}, exec_lua([[ + local dir = ... + return vim.fs.find('build', { path = dir, upward = true, type = 'directory' }) + ]], nvim_dir)) + eq({nvim_prog}, exec_lua([[ + local dir, nvim = ... + return vim.fs.find(nvim, { path = dir, type = 'file' }) + ]], test_build_dir, nvim_prog_basename)) + end) + end) end) |