aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/hl_spec.lua (renamed from test/functional/lua/highlight_spec.lua)28
-rw-r--r--test/functional/lua/vim_spec.lua15
2 files changed, 18 insertions, 25 deletions
diff --git a/test/functional/lua/highlight_spec.lua b/test/functional/lua/hl_spec.lua
index c048949df8..a123c79ffb 100644
--- a/test/functional/lua/highlight_spec.lua
+++ b/test/functional/lua/hl_spec.lua
@@ -9,7 +9,7 @@ local command = n.command
local clear = n.clear
local api = n.api
-describe('vim.highlight.range', function()
+describe('vim.hl.range', function()
local screen
before_each(function()
@@ -33,7 +33,7 @@ describe('vim.highlight.range', function()
it('works with charwise selection', function()
exec_lua(function()
local ns = vim.api.nvim_create_namespace('')
- vim.highlight.range(0, ns, 'Search', { 1, 5 }, { 3, 10 })
+ vim.hl.range(0, ns, 'Search', { 1, 5 }, { 3, 10 })
end)
screen:expect([[
^asdfghjkl{1:$} |
@@ -48,7 +48,7 @@ describe('vim.highlight.range', function()
it('works with linewise selection', function()
exec_lua(function()
local ns = vim.api.nvim_create_namespace('')
- vim.highlight.range(0, ns, 'Search', { 0, 0 }, { 4, 0 }, { regtype = 'V' })
+ vim.hl.range(0, ns, 'Search', { 0, 0 }, { 4, 0 }, { regtype = 'V' })
end)
screen:expect([[
{10:^asdfghjkl}{100:$} |
@@ -63,7 +63,7 @@ describe('vim.highlight.range', function()
it('works with blockwise selection', function()
exec_lua(function()
local ns = vim.api.nvim_create_namespace('')
- vim.highlight.range(0, ns, 'Search', { 0, 0 }, { 4, 4 }, { regtype = '\022' })
+ vim.hl.range(0, ns, 'Search', { 0, 0 }, { 4, 4 }, { regtype = '\022' })
end)
screen:expect([[
{10:^asdf}ghjkl{1:$} |
@@ -78,7 +78,7 @@ describe('vim.highlight.range', function()
it('works with blockwise selection with width', function()
exec_lua(function()
local ns = vim.api.nvim_create_namespace('')
- vim.highlight.range(0, ns, 'Search', { 0, 4 }, { 4, 7 }, { regtype = '\0226' })
+ vim.hl.range(0, ns, 'Search', { 0, 4 }, { 4, 7 }, { regtype = '\0226' })
end)
screen:expect([[
^asdf{10:ghjkl}{1:$} |
@@ -93,8 +93,8 @@ describe('vim.highlight.range', function()
it('can use -1 or v:maxcol to indicate end of line', function()
exec_lua(function()
local ns = vim.api.nvim_create_namespace('')
- vim.highlight.range(0, ns, 'Search', { 0, 4 }, { 1, -1 }, {})
- vim.highlight.range(0, ns, 'Search', { 2, 6 }, { 3, vim.v.maxcol }, {})
+ vim.hl.range(0, ns, 'Search', { 0, 4 }, { 1, -1 }, {})
+ vim.hl.range(0, ns, 'Search', { 2, 6 }, { 3, vim.v.maxcol }, {})
end)
screen:expect([[
^asdf{10:ghjkl}{100:$} |
@@ -107,7 +107,7 @@ describe('vim.highlight.range', function()
end)
end)
-describe('vim.highlight.on_yank', function()
+describe('vim.hl.on_yank', function()
before_each(function()
clear()
end)
@@ -115,7 +115,7 @@ describe('vim.highlight.on_yank', function()
it('does not show errors even if buffer is wiped before timeout', function()
command('new')
exec_lua(function()
- vim.highlight.on_yank({
+ vim.hl.on_yank({
timeout = 10,
on_macro = true,
event = { operator = 'y', regtype = 'v' },
@@ -129,10 +129,10 @@ describe('vim.highlight.on_yank', function()
it('does not close timer twice', function()
exec_lua(function()
- vim.highlight.on_yank({ timeout = 10, on_macro = true, event = { operator = 'y' } })
+ vim.hl.on_yank({ timeout = 10, on_macro = true, event = { operator = 'y' } })
vim.uv.sleep(10)
vim.schedule(function()
- vim.highlight.on_yank({ timeout = 0, on_macro = true, event = { operator = 'y' } })
+ vim.hl.on_yank({ timeout = 0, on_macro = true, event = { operator = 'y' } })
end)
end)
eq('', eval('v:errmsg'))
@@ -143,7 +143,7 @@ describe('vim.highlight.on_yank', function()
exec_lua(function()
vim.api.nvim_buf_set_mark(0, '[', 1, 1, {})
vim.api.nvim_buf_set_mark(0, ']', 1, 1, {})
- vim.highlight.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } })
+ vim.hl.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } })
end)
local ns = api.nvim_create_namespace('hlyank')
local win = api.nvim_get_current_win()
@@ -157,7 +157,7 @@ describe('vim.highlight.on_yank', function()
exec_lua(function()
vim.api.nvim_buf_set_mark(0, '[', 1, 1, {})
vim.api.nvim_buf_set_mark(0, ']', 1, 1, {})
- vim.highlight.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } })
+ vim.hl.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } })
end)
local ns = api.nvim_create_namespace('hlyank')
eq(api.nvim_get_current_win(), api.nvim__ns_get(ns).wins[1])
@@ -165,7 +165,7 @@ describe('vim.highlight.on_yank', function()
exec_lua(function()
vim.api.nvim_buf_set_mark(0, '[', 1, 1, {})
vim.api.nvim_buf_set_mark(0, ']', 1, 1, {})
- vim.highlight.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } })
+ vim.hl.on_yank({ timeout = math.huge, on_macro = true, event = { operator = 'y' } })
end)
local win = api.nvim_get_current_win()
eq({ win }, api.nvim__ns_get(ns).wins)
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 793cf7cfd7..ccb45a9d26 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -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(