aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/fs_spec.lua
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-09-15 10:33:26 +0200
committerGitHub <noreply@github.com>2023-09-15 16:33:26 +0800
commit2d9e7a33f41c842521c74d45927cfcb1874c711b (patch)
treef9baf374f6299a467acf21b5a81853107b07ee9c /test/functional/lua/fs_spec.lua
parenta6e4793bafa0edda2ef5e948cd071dc9626688d8 (diff)
downloadrneovim-2d9e7a33f41c842521c74d45927cfcb1874c711b.tar.gz
rneovim-2d9e7a33f41c842521c74d45927cfcb1874c711b.tar.bz2
rneovim-2d9e7a33f41c842521c74d45927cfcb1874c711b.zip
test(windows): unskip working tests (#25153)
Also simplify home detection with os_homedir()
Diffstat (limited to 'test/functional/lua/fs_spec.lua')
-rw-r--r--test/functional/lua/fs_spec.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua
index 2c7b3ff324..6bdb9ed79d 100644
--- a/test/functional/lua/fs_spec.lua
+++ b/test/functional/lua/fs_spec.lua
@@ -1,4 +1,5 @@
local helpers = require('test.functional.helpers')(after_each)
+local uv = require('luv')
local clear = helpers.clear
local exec_lua = helpers.exec_lua
@@ -288,11 +289,12 @@ describe('vim.fs', function()
eq('/', exec_lua [[ return vim.fs.normalize('/') ]])
end)
it('works with ~', function()
- 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') ]])
+ eq(
+ exec_lua([[
+ local home = ...
+ return home .. '/src/foo'
+ ]], vim.fs.normalize(uv.os_homedir())),
+ exec_lua [[ return vim.fs.normalize('~/src/foo') ]])
end)
it('works with environment variables', function()
local xdg_config_home = test_build_dir .. '/.config'