fix: broken tests

This commit is contained in:
shadmansaleh 2022-07-28 11:39:58 +06:00
parent e9b05e7f35
commit 8a9c97d111
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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