diff options
author | dundargoc <gocdundar@gmail.com> | 2024-03-29 18:05:02 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-03-30 00:51:09 +0100 |
commit | 2424c3e6967ef953222cf48564629ffe5812d415 (patch) | |
tree | 31ece3f3d5518627b12bf7ac13550f245fcc3406 /test/functional/lua/fs_spec.lua | |
parent | 38e38d1b401e38459842f0e4da431e3dd6c2e527 (diff) | |
download | rneovim-2424c3e6967ef953222cf48564629ffe5812d415.tar.gz rneovim-2424c3e6967ef953222cf48564629ffe5812d415.tar.bz2 rneovim-2424c3e6967ef953222cf48564629ffe5812d415.zip |
fix: support UNC paths in vim.fs.normalize
Closes https://github.com/neovim/neovim/issues/27068.
Diffstat (limited to 'test/functional/lua/fs_spec.lua')
-rw-r--r-- | test/functional/lua/fs_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index d43f32726d..6e7811908b 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -308,6 +308,15 @@ describe('vim.fs', function() ) end) + it('works with UNC paths', function() + eq('//foo', vim.fs.normalize('//foo')) -- UNC path + eq('//foo/bar', vim.fs.normalize('//foo//bar////')) -- UNC path + eq('/foo', vim.fs.normalize('///foo')) -- Not a UNC path + eq('/', vim.fs.normalize('//')) -- Not a UNC path + eq('/', vim.fs.normalize('///')) -- Not a UNC path + eq('/foo/bar', vim.fs.normalize('/foo//bar////')) -- Not a UNC path + end) + if is_os('win') then it('Last slash is not truncated from root drive', function() eq('C:/', vim.fs.normalize('C:/')) |