diff options
| author | Siddhant Agarwal <68201519+siddhantdev@users.noreply.github.com> | 2025-06-09 22:01:37 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-09 09:31:37 -0700 |
| commit | 2f0fbdaa480c5b014b68bfdb85aa105d0bef3637 (patch) | |
| tree | 559c832e978ccfec1e91971beb1176e1d202e24f /test/functional/lua/fs_spec.lua | |
| parent | 2d980e37c836a52074bea59bbeeed9b9062c26db (diff) | |
| download | rneovim-2f0fbdaa480c5b014b68bfdb85aa105d0bef3637.tar.gz rneovim-2f0fbdaa480c5b014b68bfdb85aa105d0bef3637.tar.bz2 rneovim-2f0fbdaa480c5b014b68bfdb85aa105d0bef3637.zip | |
feat(vim.fs): root() can specify "equal priority" #34276
Diffstat (limited to 'test/functional/lua/fs_spec.lua')
| -rw-r--r-- | test/functional/lua/fs_spec.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index dc1a1a0a5b..b7baed526b 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -366,6 +366,36 @@ describe('vim.fs', function() ) end) + it('nested markers have equal priority', function() + local bufnr = api.nvim_get_current_buf() + eq( + vim.fs.joinpath(test_source_path, 'test/functional'), + exec_lua( + [[return vim.fs.root(..., { 'example_spec.lua', {'CMakeLists.txt', 'CMakePresets.json'}, '.luarc.json'})]], + bufnr + ) + ) + eq( + vim.fs.joinpath(test_source_path, 'test/functional/fixtures'), + exec_lua( + [[return vim.fs.root(..., { {'CMakeLists.txt', 'CMakePresets.json'}, 'example_spec.lua', '.luarc.json'})]], + bufnr + ) + ) + eq( + vim.fs.joinpath(test_source_path, 'test/functional/fixtures'), + exec_lua( + [[return vim.fs.root(..., { + function(name, _) + return name:match('%.txt$') + end, + 'example_spec.lua', + '.luarc.json' })]], + bufnr + ) + ) + end) + it('works with a function', function() ---@type string local result = exec_lua(function() |