Merge #31358 fix test failures for release / tarball builds

This commit is contained in:
Justin M. Keyes
2024-12-04 07:20:04 -08:00
committed by GitHub
5 changed files with 23 additions and 19 deletions

View File

@@ -273,14 +273,14 @@ describe('vim.fs', function()
end)
it('works with a single marker', function()
eq(test_source_path, exec_lua([[return vim.fs.root(0, '.git')]]))
eq(test_source_path, exec_lua([[return vim.fs.root(0, 'CMakePresets.json')]]))
end)
it('works with multiple markers', function()
local bufnr = api.nvim_get_current_buf()
eq(
vim.fs.joinpath(test_source_path, 'test/functional/fixtures'),
exec_lua([[return vim.fs.root(..., {'CMakeLists.txt', '.git'})]], bufnr)
exec_lua([[return vim.fs.root(..., {'CMakeLists.txt', 'CMakePresets.json'})]], bufnr)
)
end)
@@ -295,26 +295,26 @@ describe('vim.fs', function()
end)
it('works with a filename argument', function()
eq(test_source_path, exec_lua([[return vim.fs.root(..., '.git')]], nvim_prog))
eq(test_source_path, exec_lua([[return vim.fs.root(..., 'CMakePresets.json')]], nvim_prog))
end)
it('works with a relative path', function()
eq(
test_source_path,
exec_lua([[return vim.fs.root(..., '.git')]], vim.fs.basename(nvim_prog))
exec_lua([[return vim.fs.root(..., 'CMakePresets.json')]], vim.fs.basename(nvim_prog))
)
end)
it('uses cwd for unnamed buffers', function()
command('new')
eq(test_source_path, exec_lua([[return vim.fs.root(0, '.git')]]))
eq(test_source_path, exec_lua([[return vim.fs.root(0, 'CMakePresets.json')]]))
end)
it("uses cwd for buffers with non-empty 'buftype'", function()
command('new')
command('set buftype=nofile')
command('file lua://')
eq(test_source_path, exec_lua([[return vim.fs.root(0, '.git')]]))
eq(test_source_path, exec_lua([[return vim.fs.root(0, 'CMakePresets.json')]]))
end)
end)