aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/diagnostic_spec.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 17:59:57 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 18:59:14 +0000
commit795f896a5772d5e0795f86642bdf90c82efac45c (patch)
tree308f04fbee18d2ec3f00c12a8bec96b84d8907f0 /test/functional/lua/diagnostic_spec.lua
parent4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (diff)
downloadrneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.gz
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.bz2
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.zip
test: rename (meths, funcs) -> (api, fn)
Diffstat (limited to 'test/functional/lua/diagnostic_spec.lua')
-rw-r--r--test/functional/lua/diagnostic_spec.lua60
1 files changed, 30 insertions, 30 deletions
diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua
index 523e771266..5802925339 100644
--- a/test/functional/lua/diagnostic_spec.lua
+++ b/test/functional/lua/diagnostic_spec.lua
@@ -6,7 +6,7 @@ local clear = helpers.clear
local exec_lua = helpers.exec_lua
local eq = helpers.eq
local matches = helpers.matches
-local meths = helpers.meths
+local api = helpers.api
local pcall_err = helpers.pcall_err
describe('vim.diagnostic', function()
@@ -1563,8 +1563,8 @@ describe('vim.diagnostic', function()
it('can perform updates after insert_leave', function()
exec_lua [[vim.api.nvim_set_current_buf(diagnostic_bufnr)]]
- meths.nvim_input('o')
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('o')
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
-- Save the diagnostics
exec_lua [[
@@ -1577,15 +1577,15 @@ describe('vim.diagnostic', function()
]]
-- No diagnostics displayed yet.
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
eq(
1,
exec_lua [[return count_diagnostics(diagnostic_bufnr, vim.diagnostic.severity.ERROR, diagnostic_ns)]]
)
eq(0, exec_lua [[return count_extmarks(diagnostic_bufnr, diagnostic_ns)]])
- meths.nvim_input('<esc>')
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('<esc>')
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
eq(
1,
@@ -1596,8 +1596,8 @@ describe('vim.diagnostic', function()
it('does not perform updates when not needed', function()
exec_lua [[vim.api.nvim_set_current_buf(diagnostic_bufnr)]]
- meths.nvim_input('o')
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('o')
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
-- Save the diagnostics
exec_lua [[
@@ -1619,7 +1619,7 @@ describe('vim.diagnostic', function()
]]
-- No diagnostics displayed yet.
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
eq(
1,
exec_lua [[return count_diagnostics(diagnostic_bufnr, vim.diagnostic.severity.ERROR, diagnostic_ns)]]
@@ -1627,8 +1627,8 @@ describe('vim.diagnostic', function()
eq(0, exec_lua [[return count_extmarks(diagnostic_bufnr, diagnostic_ns)]])
eq(0, exec_lua [[return DisplayCount]])
- meths.nvim_input('<esc>')
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('<esc>')
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
eq(
1,
@@ -1638,11 +1638,11 @@ describe('vim.diagnostic', function()
eq(1, exec_lua [[return DisplayCount]])
-- Go in and out of insert mode one more time.
- meths.nvim_input('o')
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('o')
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
- meths.nvim_input('<esc>')
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('<esc>')
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
-- Should not have set the virtual text again.
eq(1, exec_lua [[return DisplayCount]])
@@ -1650,8 +1650,8 @@ describe('vim.diagnostic', function()
it('never sets virtual text, in combination with insert leave', function()
exec_lua [[vim.api.nvim_set_current_buf(diagnostic_bufnr)]]
- meths.nvim_input('o')
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('o')
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
-- Save the diagnostics
exec_lua [[
@@ -1674,7 +1674,7 @@ describe('vim.diagnostic', function()
]]
-- No diagnostics displayed yet.
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
eq(
1,
exec_lua [[return count_diagnostics(diagnostic_bufnr, vim.diagnostic.severity.ERROR, diagnostic_ns)]]
@@ -1682,8 +1682,8 @@ describe('vim.diagnostic', function()
eq(0, exec_lua [[return count_extmarks(diagnostic_bufnr, diagnostic_ns)]])
eq(0, exec_lua [[return DisplayCount]])
- meths.nvim_input('<esc>')
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('<esc>')
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
eq(
1,
@@ -1693,11 +1693,11 @@ describe('vim.diagnostic', function()
eq(0, exec_lua [[return DisplayCount]])
-- Go in and out of insert mode one more time.
- meths.nvim_input('o')
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('o')
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
- meths.nvim_input('<esc>')
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('<esc>')
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
-- Should not have set the virtual text still.
eq(0, exec_lua [[return DisplayCount]])
@@ -1705,8 +1705,8 @@ describe('vim.diagnostic', function()
it('can perform updates while in insert mode, if desired', function()
exec_lua [[vim.api.nvim_set_current_buf(diagnostic_bufnr)]]
- meths.nvim_input('o')
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('o')
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
-- Save the diagnostics
exec_lua [[
@@ -1720,15 +1720,15 @@ describe('vim.diagnostic', function()
]]
-- Diagnostics are displayed, because the user wanted them that way!
- eq({ mode = 'i', blocking = false }, meths.nvim_get_mode())
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
eq(
1,
exec_lua [[return count_diagnostics(diagnostic_bufnr, vim.diagnostic.severity.ERROR, diagnostic_ns)]]
)
eq(2, exec_lua [[return count_extmarks(diagnostic_bufnr, diagnostic_ns)]])
- meths.nvim_input('<esc>')
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ api.nvim_input('<esc>')
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
eq(
1,
@@ -1825,7 +1825,7 @@ describe('vim.diagnostic', function()
it('respects legacy signs placed with :sign define or sign_define #26618', function()
-- Legacy signs for diagnostics were deprecated in 0.10 and will be removed in 0.12
- eq(0, helpers.funcs.has('nvim-0.12'))
+ eq(0, helpers.fn.has('nvim-0.12'))
helpers.command(
'sign define DiagnosticSignError text= texthl= linehl=ErrorMsg numhl=ErrorMsg'