diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-01-24 13:01:35 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-01-24 13:01:35 +0800 |
commit | c0a97d982ae0ce56e70dfdac9c5ec8bd7e99c32d (patch) | |
tree | 803d61deac773e6cb1297d75dbbd8eef5eb637f9 | |
parent | 9bb9f175925a9bc467f39921bcc2861ff45eeaa1 (diff) | |
download | rneovim-c0a97d982ae0ce56e70dfdac9c5ec8bd7e99c32d.tar.gz rneovim-c0a97d982ae0ce56e70dfdac9c5ec8bd7e99c32d.tar.bz2 rneovim-c0a97d982ae0ce56e70dfdac9c5ec8bd7e99c32d.zip |
test(unit): add unit tests for path_with_url
-rw-r--r-- | test/unit/path_spec.lua | 16 |
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) |