fix(keys): replace term codes to calculate ids

This commit is contained in:
Folke Lemaitre 2023-06-03 13:45:18 +02:00
parent 9223c1aa20
commit d65a3d6755
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,18 @@
local Keys = require("lazy.core.handler.keys")
describe("keys", function()
it("parses ids correctly", function()
local tests = {
{ "<C-/>", "<c-/>", true },
{ "<C-h>", "<c-H>", true },
{ "<C-h>k", "<c-H>K", false },
}
for _, test in ipairs(tests) do
if test[3] then
assert.same(Keys.parse(test[1]).id, Keys.parse(test[2]).id)
else
assert.is_not.same(Keys.parse(test[1]).id, Keys.parse(test[2]).id)
end
end
end)
end)