aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/health_spec.lua
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-04-20 17:44:13 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-04-23 18:17:04 +0200
commit052498ed42780a76daea589d063cd8947a894673 (patch)
treeb6c85416a4d7ced5eabb0a7a3866f5e0fee886cc /test/functional/plugin/health_spec.lua
parentc5af5c0b9ab84c86f84e32210512923e7eb641ba (diff)
downloadrneovim-052498ed42780a76daea589d063cd8947a894673.tar.gz
rneovim-052498ed42780a76daea589d063cd8947a894673.tar.bz2
rneovim-052498ed42780a76daea589d063cd8947a894673.zip
test: improve test conventions
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
Diffstat (limited to 'test/functional/plugin/health_spec.lua')
-rw-r--r--test/functional/plugin/health_spec.lua35
1 files changed, 18 insertions, 17 deletions
diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua
index 9c17e74e19..78cffd07fb 100644
--- a/test/functional/plugin/health_spec.lua
+++ b/test/functional/plugin/health_spec.lua
@@ -1,17 +1,18 @@
-local t = require('test.functional.testutil')()
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = t.clear
-local curbuf_contents = t.curbuf_contents
-local command = t.command
+local clear = n.clear
+local curbuf_contents = n.curbuf_contents
+local command = n.command
local eq, neq, matches = t.eq, t.neq, t.matches
-local getcompletion = t.fn.getcompletion
-local exec_lua = t.exec_lua
-local assert_alive = t.assert_alive
-local insert = t.insert
-local source = t.source
-local fn = t.fn
-local api = t.api
+local getcompletion = n.fn.getcompletion
+local insert = n.insert
+local exec_lua = n.exec_lua
+local source = n.source
+local assert_alive = n.assert_alive
+local fn = n.fn
+local api = n.api
describe(':checkhealth', function()
it('detects invalid $VIMRUNTIME', function()
@@ -67,7 +68,7 @@ describe('health.vim', function()
describe(':checkhealth', function()
it('functions report_*() render correctly', function()
command('checkhealth full_render')
- t.expect([[
+ n.expect([[
==============================================================================
test_plug.full_render: require("test_plug.full_render.health").check()
@@ -90,7 +91,7 @@ describe('health.vim', function()
it('concatenates multiple reports', function()
command('checkhealth success1 success2 test_plug')
- t.expect([[
+ n.expect([[
==============================================================================
test_plug: require("test_plug.health").check()
@@ -120,7 +121,7 @@ describe('health.vim', function()
it('lua plugins submodules', function()
command('checkhealth test_plug.submodule')
- t.expect([[
+ n.expect([[
==============================================================================
test_plug.submodule: require("test_plug.submodule.health").check()
@@ -135,7 +136,7 @@ describe('health.vim', function()
it('... including empty reports', function()
command('checkhealth test_plug.submodule_empty')
- t.expect([[
+ n.expect([[
==============================================================================
test_plug.submodule_empty: require("test_plug.submodule_empty.health").check()
@@ -176,7 +177,7 @@ describe('health.vim', function()
it('gracefully handles invalid healthcheck', function()
command('checkhealth non_existent_healthcheck')
-- luacheck: ignore 613
- t.expect([[
+ n.expect([[
==============================================================================
non_existent_healthcheck:
@@ -188,7 +189,7 @@ describe('health.vim', function()
it('does not use vim.health as a healtcheck', function()
-- vim.health is not a healthcheck
command('checkhealth vim')
- t.expect([[
+ n.expect([[
ERROR: No healthchecks found.]])
end)
end)