diff options
author | John Szakmeister <john@szakmeister.net> | 2015-02-11 19:45:26 -0500 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2015-02-11 19:45:26 -0500 |
commit | f1f1f711c78e408b39fd35bdb97cb17cd3994111 (patch) | |
tree | e0e6ea2edce9a879cdce56c5b39241278b3dc5e2 | |
parent | e177357fc8da94571d7c476d2260928dc2a8b948 (diff) | |
parent | 41d8c8980b088e509c577a35c765d498d5498581 (diff) | |
download | rneovim-f1f1f711c78e408b39fd35bdb97cb17cd3994111.tar.gz rneovim-f1f1f711c78e408b39fd35bdb97cb17cd3994111.tar.bz2 rneovim-f1f1f711c78e408b39fd35bdb97cb17cd3994111.zip |
Merge pull request #1965 from jszakmeister/fix-fs-spec-test-for-freebsd
Fix an fs_spec test under FreeBSD and a symlinked home directory.
-rw-r--r-- | test/unit/os/fs_spec.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index 7051ed3797..9e5a2349c8 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) |