aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/unit/os/fs_spec.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua
index 90f5a0b7de..1c7d3650a5 100644
--- a/test/unit/os/fs_spec.lua
+++ b/test/unit/os/fs_spec.lua
@@ -170,12 +170,20 @@ describe('fs function', function()
it('returns the absolute path when given an executable relative to the current dir', function()
local old_dir = lfs.currentdir()
+
lfs.chdir(directory)
local relative_executable = './' .. executable_name
+
-- Don't test yet; we need to chdir back first.
local res = exe(relative_executable)
+
lfs.chdir(old_dir)
- eq(absolute_executable, res)
+
+ -- 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)