mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #2320 from richchurcher/fix_path_test
Use lfs.currentdir() to fix symlink test fail.
This commit is contained in:
commit
4f7d515be4
@ -172,17 +172,17 @@ describe('fs function', function()
|
||||
local old_dir = lfs.currentdir()
|
||||
|
||||
lfs.chdir(directory)
|
||||
local relative_executable = './' .. executable_name
|
||||
|
||||
-- Don't test yet; we need to chdir back first.
|
||||
-- Rely on currentdir to resolve symlinks, if any. Testing against
|
||||
-- the absolute path taken from arg[0] may result in failure where
|
||||
-- the path has a symlink in it.
|
||||
local canonical = lfs.currentdir() .. '/' .. executable_name
|
||||
local expected = exe(canonical)
|
||||
local relative_executable = './' .. executable_name
|
||||
local res = exe(relative_executable)
|
||||
|
||||
-- Don't test yet; we need to chdir back first.
|
||||
lfs.chdir(old_dir)
|
||||
|
||||
-- Need to canonicalize the absolute path taken from arg[0], because the
|
||||
-- path may have a symlink in it. For example, /home is symlinked in
|
||||
-- FreeBSD 10's VM image.
|
||||
local expected = exe(absolute_executable)
|
||||
eq(expected, res)
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user