refactor!: remove deprecated APIs

This commit is contained in:
Yi Ming
2026-05-11 15:42:24 +08:00
parent eb79cf5aee
commit fd51fb3fa0
8 changed files with 35 additions and 464 deletions

View File

@@ -1315,29 +1315,6 @@ describe('lua stdlib', function()
eq({ 2 }, exec_lua [[ return vim.list_extend({}, {2;a=1}, -1, 2) ]])
end)
it('vim.tbl_add_reverse_lookup', function()
eq(
true,
exec_lua [[
local a = { A = 1 }
vim.tbl_add_reverse_lookup(a)
return vim.deep_equal(a, { A = 1; [1] = 'A'; })
]]
)
-- Throw an error for trying to do it twice (run into an existing key)
local code = [[
local res = {}
local a = { A = 1 }
vim.tbl_add_reverse_lookup(a)
assert(vim.deep_equal(a, { A = 1; [1] = 'A'; }))
vim.tbl_add_reverse_lookup(a)
]]
matches(
'The reverse lookup found an existing value for "[1A]" while processing key "[1A]"$',
pcall_err(exec_lua, code)
)
end)
it('vim.spairs', function()
local res = ''
local table = {