diff options
Diffstat (limited to 'test/functional/lua/fs_spec.lua')
-rw-r--r-- | test/functional/lua/fs_spec.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index da60b5c13b..2fcbc9450f 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -1,5 +1,4 @@ local helpers = require('test.functional.helpers')(after_each) -local lfs = require('lfs') local clear = helpers.clear local exec_lua = helpers.exec_lua @@ -11,6 +10,7 @@ local test_build_dir = helpers.test_build_dir local test_source_path = helpers.test_source_path local nvim_prog = helpers.nvim_prog local is_os = helpers.is_os +local mkdir = helpers.mkdir local nvim_prog_basename = is_os('win') and 'nvim.exe' or 'nvim' @@ -133,10 +133,10 @@ describe('vim.fs', function() describe('dir()', function() before_each(function() - lfs.mkdir('testd') - lfs.mkdir('testd/a') - lfs.mkdir('testd/a/b') - lfs.mkdir('testd/a/b/c') + mkdir('testd') + mkdir('testd/a') + mkdir('testd/a/b') + mkdir('testd/a/b/c') end) after_each(function() @@ -271,10 +271,11 @@ describe('vim.fs', function() eq('C:/Users/jdoe', exec_lua [[ return vim.fs.normalize('C:\\Users\\jdoe') ]]) end) it('works with ~', function() - if is_os('win') then - pending([[$HOME does not exist on Windows ¯\_(ツ)_/¯]]) - end - eq(os.getenv('HOME') .. '/src/foo', exec_lua [[ return vim.fs.normalize('~/src/foo') ]]) + eq( exec_lua([[ + local home = ... + return home .. '/src/foo' + ]], is_os('win') and vim.fs.normalize(os.getenv('USERPROFILE')) or os.getenv('HOME') + ) , exec_lua [[ return vim.fs.normalize('~/src/foo') ]]) end) it('works with environment variables', function() local xdg_config_home = test_build_dir .. '/.config' |