aboutsummaryrefslogtreecommitdiff
path: root/test/functional/fixtures/lua
diff options
context:
space:
mode:
authorJavier López <graulopezjavier@gmail.com>2021-08-03 16:09:26 -0500
committerJavier López <graulopezjavier@gmail.com>2021-10-04 14:28:54 -0500
commitc65f9560155a8f37b1a2fe15e1bdbebe191fc494 (patch)
treef2e51de3c8439ef48a57126044b3955f3c44b24c /test/functional/fixtures/lua
parent9249dcdda1bd40c291d661650df584583cac3cf4 (diff)
downloadrneovim-c65f9560155a8f37b1a2fe15e1bdbebe191fc494.tar.gz
rneovim-c65f9560155a8f37b1a2fe15e1bdbebe191fc494.tar.bz2
rneovim-c65f9560155a8f37b1a2fe15e1bdbebe191fc494.zip
test(runtime/health): cover lua healthchecks
- Add tests for lua healthchecks (failure, success and submodules). - Reword some of the test naming for improved logs readability. - Modify render test to accomodate the changes of the health autoload function. - Add test for :checkhealth completion of Lua healtchecks.
Diffstat (limited to 'test/functional/fixtures/lua')
-rw-r--r--test/functional/fixtures/lua/test_plug/health/init.lua11
-rw-r--r--test/functional/fixtures/lua/test_plug/submodule/health.lua11
-rw-r--r--test/functional/fixtures/lua/test_plug/submodule_failed/health.lua12
3 files changed, 34 insertions, 0 deletions
diff --git a/test/functional/fixtures/lua/test_plug/health/init.lua b/test/functional/fixtures/lua/test_plug/health/init.lua
new file mode 100644
index 0000000000..d07632cff4
--- /dev/null
+++ b/test/functional/fixtures/lua/test_plug/health/init.lua
@@ -0,0 +1,11 @@
+local M = {}
+local health = require("health")
+
+M.check = function()
+ health.report_start("report 1")
+ health.report_ok("everything is fine")
+ health.report_start("report 2")
+ health.report_ok("nothing to see here")
+end
+
+return M
diff --git a/test/functional/fixtures/lua/test_plug/submodule/health.lua b/test/functional/fixtures/lua/test_plug/submodule/health.lua
new file mode 100644
index 0000000000..d07632cff4
--- /dev/null
+++ b/test/functional/fixtures/lua/test_plug/submodule/health.lua
@@ -0,0 +1,11 @@
+local M = {}
+local health = require("health")
+
+M.check = function()
+ health.report_start("report 1")
+ health.report_ok("everything is fine")
+ health.report_start("report 2")
+ health.report_ok("nothing to see here")
+end
+
+return M
diff --git a/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua b/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua
new file mode 100644
index 0000000000..3a8af6ebb2
--- /dev/null
+++ b/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua
@@ -0,0 +1,12 @@
+local M = {}
+local health = require("health")
+
+M.check = function()
+ health.report_start("report 1")
+ health.report_ok("everything is fine")
+ health.report_warn("About to add a number to nil")
+ local a = nil + 2
+ return a
+end
+
+return M