Problem: the codebase still used the upstream \`oil\` naming everywhere — URL schemes, the \`:Oil\` command, highlight groups, user events, module paths, filetypes, buffer/window variables, LuaCATS type annotations, vimdoc help tags, syntax groups, and internal identifiers. Solution: mechanical rename of every reference. URL schemes now use \`canola://\` (plus \`canola-ssh://\`, \`canola-s3://\`, \`canola-sss://\`, \`canola-trash://\`, \`canola-test://\`). The \`:Canola\` command replaces \`:Oil\`. All highlight groups, user events, augroups, namespaces, filetypes, require paths, type annotations, help tags, and identifiers follow suit. The \`upstream\` remote to \`stevearc/oil.nvim\` has been removed and the \`vim.g.oil\` deprecation shim dropped.
29 lines
776 B
Lua
29 lines
776 B
Lua
local util = require('canola.util')
|
|
describe('util', function()
|
|
it('url_escape', function()
|
|
local cases = {
|
|
{ 'foobar', 'foobar' },
|
|
{ 'foo bar', 'foo%20bar' },
|
|
{ '/foo/bar', '%2Ffoo%2Fbar' },
|
|
}
|
|
for _, case in ipairs(cases) do
|
|
local input, expected = unpack(case)
|
|
local output = util.url_escape(input)
|
|
assert.equals(expected, output)
|
|
end
|
|
end)
|
|
|
|
it('url_unescape', function()
|
|
local cases = {
|
|
{ 'foobar', 'foobar' },
|
|
{ 'foo%20bar', 'foo bar' },
|
|
{ '%2Ffoo%2Fbar', '/foo/bar' },
|
|
{ 'foo%%bar', 'foo%%bar' },
|
|
}
|
|
for _, case in ipairs(cases) do
|
|
local input, expected = unpack(case)
|
|
local output = util.url_unescape(input)
|
|
assert.equals(expected, output)
|
|
end
|
|
end)
|
|
end)
|