diff options
| -rw-r--r-- | cmake/RunTests.cmake | 3 | ||||
| -rw-r--r-- | test/unit/os/fs_spec.lua | 15 | 
2 files changed, 5 insertions, 13 deletions
| diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 58f19b6fa5..19aaf85d0f 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -1,6 +1,3 @@ -get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH) -set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}") -  set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)  set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest)  set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config) diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index 5d889d6e33..516fb5a7d1 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -23,7 +23,7 @@ cimport('./src/nvim/os/shell.h')  cimport('./src/nvim/option_defs.h')  cimport('./src/nvim/main.h')  cimport('./src/nvim/fileio.h') -local fs = cimport('./src/nvim/os/os.h') +local fs = cimport('./src/nvim/os/os.h', './src/nvim/path.h')  cppimport('sys/stat.h')  cppimport('fcntl.h')  cppimport('uv-errno.h') @@ -77,11 +77,9 @@ describe('fs function', function()      lfs.link('test.file', 'unit-test-directory/test_link.file', true)      lfs.link('non_existing_file.file', 'unit-test-directory/test_broken_link.file', true) -    -- Since the tests are executed, they are called by an executable. We use -    -- that executable for several asserts. +    -- The tests are invoked with an absolute path to `busted` executable.      absolute_executable = arg[0] -    -- Split absolute_executable into a directory and the actual file name for -    -- later usage. +    -- Split the absolute_executable path into a directory and filename.      directory, executable_name = string.match(absolute_executable, '^(.*)/(.*)$')    end) @@ -194,11 +192,8 @@ describe('fs function', function()      end)      it('returns the absolute path when given an executable inside $PATH', function() -      -- Since executable_name does not start with "./", the path will be -      -- selected from $PATH. Make sure the ends match, ignore the directories. -      local _, busted = string.match(absolute_executable, '^(.*)/(.*)$') -      local _, name = string.match(exe(executable_name), '^(.*)/(.*)$') -      eq(busted, name) +      local fullpath = exe('ls') +      eq(1, fs.path_is_absolute_path(to_cstr(fullpath)))      end)      it('returns the absolute path when given an executable relative to the current dir', function() | 
