From 8a9c97d111142216c53f83d69030fd9bfe753bb7 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Thu, 28 Jul 2022 11:39:58 +0600 Subject: [PATCH] fix: broken tests --- tests/spec/lualine_spec.lua | 7 +------ tests/statusline.lua | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/spec/lualine_spec.lua b/tests/spec/lualine_spec.lua index 9e39570..f433c7d 100644 --- a/tests/spec/lualine_spec.lua +++ b/tests/spec/lualine_spec.lua @@ -253,12 +253,7 @@ describe('Lualine', function() require('lualine').setup(config) local old_ft = vim.bo.ft vim.bo.ft = 'test_ft' - statusline:expect([===[ - highlights = { - 1: StatusLine = { bold = true, reverse = true } - } - || - ]===]) + statusline:expect(nil) vim.bo.ft = old_ft end) diff --git a/tests/statusline.lua b/tests/statusline.lua index 6f6a987..0dac80d 100644 --- a/tests/statusline.lua +++ b/tests/statusline.lua @@ -210,6 +210,11 @@ local function eval_stl(stl_expr, width, eval_type) end function M:expect_expr(expect, expr) + if expr == nil then + -- test if both are nil when running expect against nil + assert.are.same(expect, nil) + return + end expect = helpers.dedent(expect) local actual = eval_stl(expr, self.width, self.type) local matched = true