mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
test(unit): add unit tests for path_with_url
This commit is contained in:
@@ -626,4 +626,20 @@ describe('path.c', function()
|
|||||||
eq(false, path_with_extension('/some/path/file', 'lua'))
|
eq(false, path_with_extension('/some/path/file', 'lua'))
|
||||||
end)
|
end)
|
||||||
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)
|
end)
|
||||||
|
Reference in New Issue
Block a user