* feat: copy/paste to system clipboard on macOS * stylua * feat: copy/paste to system clipboard on linux * force mime type * fix string.gsub * vim.uv or vim.loop * fix stylua * support gnome directly * support wayland * refactor: extract clipboard actions into separate file * fix: copy/paste in KDE * refactor: simplify file loading * fix: copy/paste on x11 * fix: better error message when clipboard command not found * fix: paste on mac * fix: pasting in Gnome * feat: support pasting multiple files * feat: support copying multiple files to clipboard --------- Co-authored-by: Steve Walker <65963536+etherswangel@users.noreply.github.com> Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
29 lines
773 B
Lua
29 lines
773 B
Lua
local util = require("oil.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)
|