diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-11 05:50:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 05:50:49 +0800 |
commit | 851252f79ddaaca5456b287342cd36130c76ff38 (patch) | |
tree | 37773bdbc48c3f43ae950e6447f455cd08a74d71 /test | |
parent | 38bf52821a2f647f310641bcb82b2d09ba27c2b1 (diff) | |
parent | 300b009f47bc617faa1c445966e2085c455e0c45 (diff) | |
download | rneovim-851252f79ddaaca5456b287342cd36130c76ff38.tar.gz rneovim-851252f79ddaaca5456b287342cd36130c76ff38.tar.bz2 rneovim-851252f79ddaaca5456b287342cd36130c76ff38.zip |
Merge pull request #17012 from EdmundsEcho/fix-checkhealth
prevent checkhealth failure when plugin's check returns void
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/fixtures/lua/test_plug/submodule_empty/health.lua | 7 | ||||
-rw-r--r-- | test/functional/plugin/health_spec.lua | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/fixtures/lua/test_plug/submodule_empty/health.lua b/test/functional/fixtures/lua/test_plug/submodule_empty/health.lua new file mode 100644 index 0000000000..d2cf86e4f0 --- /dev/null +++ b/test/functional/fixtures/lua/test_plug/submodule_empty/health.lua @@ -0,0 +1,7 @@ +local M = {} + +M.check = function() + return {} +end + +return M diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua index f7c2dbdb43..a9bd76ce24 100644 --- a/test/functional/plugin/health_spec.lua +++ b/test/functional/plugin/health_spec.lua @@ -153,6 +153,10 @@ describe('health.vim', function() ## report 2 - OK: nothing to see here + test_plug.submodule_empty: require("test_plug.submodule_empty.health").check() + ======================================================================== + - ERROR: The healthcheck report for "test_plug.submodule_empty" plugin is empty. + test_plug.submodule_failed: require("test_plug.submodule_failed.health").check() ======================================================================== - ERROR: Failed to run healthcheck for "test_plug.submodule_failed" plugin. Exception: @@ -172,6 +176,16 @@ describe('health.vim', function() ]]) end) + it("... including empty reports", function() + command("checkhealth test_plug.submodule_empty") + helpers.expect([[ + + test_plug.submodule_empty: require("test_plug.submodule_empty.health").check() + ======================================================================== + - ERROR: The healthcheck report for "test_plug.submodule_empty" plugin is empty. + ]]) + end) + it("gracefully handles broken lua healthcheck", function() command("checkhealth test_plug.submodule_failed") local buf_lines = helpers.curbuf('get_lines', 0, -1, true) |