aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/uri_spec.lua
diff options
context:
space:
mode:
authorHirokazu Hata <h.hata.ai.t@gmail.com>2020-03-30 21:30:24 +0900
committerGitHub <noreply@github.com>2020-03-30 14:30:24 +0200
commit4139678f97ee556ab142031a1ed5c7580278b64f (patch)
tree0788bfa6572893e4de325d7522387b9854ce7c12 /test/functional/lua/uri_spec.lua
parente700a88bb6bdc96f4d62a384aecd3bec2040ac3b (diff)
downloadrneovim-4139678f97ee556ab142031a1ed5c7580278b64f.tar.gz
rneovim-4139678f97ee556ab142031a1ed5c7580278b64f.tar.bz2
rneovim-4139678f97ee556ab142031a1ed5c7580278b64f.zip
vim.uri: fix uri_to_fname (#12059)
fix: #12056 If the colon of the drive letter of windows is URI encoded, it doesn't match the expected pattern, so decode it first.
Diffstat (limited to 'test/functional/lua/uri_spec.lua')
-rw-r--r--test/functional/lua/uri_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/lua/uri_spec.lua b/test/functional/lua/uri_spec.lua
index 19b1eb1f61..128c7c6137 100644
--- a/test/functional/lua/uri_spec.lua
+++ b/test/functional/lua/uri_spec.lua
@@ -85,6 +85,15 @@ describe('URI methods', function()
eq('C:\\Foo\\Bar\\Baz.txt', exec_lua(test_case))
end)
+ it('file path includes only ascii charactors with encoded colon character', function()
+ local test_case = [[
+ local uri = 'file:///C%3A/Foo/Bar/Baz.txt'
+ return vim.uri_to_fname(uri)
+ ]]
+
+ eq('C:\\Foo\\Bar\\Baz.txt', exec_lua(test_case))
+ end)
+
it('file path including white space', function()
local test_case = [[
local uri = 'file:///C:/Foo%20/Bar/Baz.txt'