aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-01-27 08:32:02 +0100
committerGitHub <noreply@github.com>2022-01-27 08:32:02 +0100
commit47b50d5a1c8c9ffb330cbac817c0235bc6298457 (patch)
tree62106738070e5fbce11eb1eac5c06d209162632b /test
parentf1b91fcdbdf5f2e639aed8155c6d668c0b33ec6c (diff)
parentc0a97d982ae0ce56e70dfdac9c5ec8bd7e99c32d (diff)
downloadrneovim-47b50d5a1c8c9ffb330cbac817c0235bc6298457.tar.gz
rneovim-47b50d5a1c8c9ffb330cbac817c0235bc6298457.tar.bz2
rneovim-47b50d5a1c8c9ffb330cbac817c0235bc6298457.zip
Merge pull request #17174 from zeertzjq/vim-8.2.3153
vim-patch:8.2.3153: URLs with a dash in the scheme are not recognized
Diffstat (limited to 'test')
-rw-r--r--test/unit/path_spec.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index 15ce59747e..fb476397e6 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -626,4 +626,20 @@ describe('path.c', function()
eq(false, path_with_extension('/some/path/file', 'lua'))
end)
end)
+
+ describe('path_with_url', function()
+ itp('scheme is alpha and inner hyphen only', function()
+ local function path_with_url(fname)
+ return cimp.path_with_url(to_cstr(fname))
+ end
+ eq(1, path_with_url([[test://xyz/foo/b0]]))
+ eq(2, path_with_url([[test:\\xyz\foo\b0]]))
+ eq(0, path_with_url([[test+abc://xyz/foo/b1]]))
+ eq(0, path_with_url([[test_abc://xyz/foo/b2]]))
+ eq(1, path_with_url([[test-abc://xyz/foo/b3]]))
+ eq(2, path_with_url([[test-abc:\\xyz\foo\b3]]))
+ eq(0, path_with_url([[-test://xyz/foo/b4]]))
+ eq(0, path_with_url([[test-://xyz/foo/b5]]))
+ end)
+ end)
end)