fix(lua): vim.deprecate does not support major>0

This commit is contained in:
Justin M. Keyes
2024-10-17 17:58:13 +02:00
parent c9c17fda80
commit 960fdc775a
3 changed files with 18 additions and 17 deletions

View File

@@ -155,10 +155,10 @@ describe('lua stdlib', function()
end)
it('plugin=nil, no error if soft-deprecated', function()
eq(
vim.NIL,
exec_lua('return vim.deprecate(...)', 'foo.baz()', 'foo.better_baz()', '0.99.0')
)
eq(vim.NIL, exec_lua [[return vim.deprecate('old1', 'new1', '0.99.0')]])
-- Major version > current Nvim major is always "soft-deprecated".
-- XXX: This is also a reminder to update the hardcoded `nvim_major`, when Nvim reaches 1.0.
eq(vim.NIL, exec_lua [[return vim.deprecate('old2', 'new2', '1.0.0')]])
end)
it('plugin=nil, show error if hard-deprecated', function()
@@ -175,13 +175,6 @@ describe('lua stdlib', function()
)
end)
it('plugin=nil, to be deleted in the next major version (1.0)', function()
eq(
[[foo.baz() is deprecated. Run ":checkhealth vim.deprecated" for more information]],
exec_lua [[ return vim.deprecate('foo.baz()', nil, '1.0') ]]
)
end)
it('plugin specified', function()
-- When `plugin` is specified, don't show ":help deprecated". #22235
eq(