From 1569202d39c40d7a44de5eb1b10cf203dd33af41 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Tue, 12 Apr 2022 11:18:17 +0200 Subject: fix(impatient): avoid get_options in fast handler (#2451) --- tests/specs/config_loader_spec.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'tests/specs/config_loader_spec.lua') diff --git a/tests/specs/config_loader_spec.lua b/tests/specs/config_loader_spec.lua index 1f2debc7..40eaa350 100644 --- a/tests/specs/config_loader_spec.lua +++ b/tests/specs/config_loader_spec.lua @@ -4,16 +4,28 @@ local config = require "lvim.config" a.describe("config-loader", function() local user_config_path = config:get_user_config_path() + before_each(function() + vim.cmd [[ + let v:errmsg = "" + let v:errors = [] + ]] + end) + + after_each(function() + local errmsg = vim.fn.eval "v:errmsg" + local exception = vim.fn.eval "v:exception" + local errors = vim.fn.eval "v:errors" + assert.equal("", errmsg) + assert.equal("", exception) + assert.True(vim.tbl_isempty(errors)) + end) + a.it("should be able to find user-config", function() assert.equal(user_config_path, get_config_dir() .. "/config.lua") end) a.it("should be able to load user-config without errors", function() config:load(user_config_path) - local errmsg = vim.fn.eval "v:errmsg" - local exception = vim.fn.eval "v:exception" - assert.equal("", errmsg) -- v:errmsg was not updated. - assert.equal("", exception) end) a.it("should be able to reload user-config without errors", function() -- cgit v1.2.3