mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test(unit): add unit tests for path_with_url
This commit is contained in:
parent
9bb9f17592
commit
c0a97d982a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user