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) require('lualine').setup(config)
local old_ft = vim.bo.ft local old_ft = vim.bo.ft
vim.bo.ft = 'test_ft' vim.bo.ft = 'test_ft'
statusline:expect([===[ statusline:expect(nil)
highlights = {
1: StatusLine = { bold = true, reverse = true }
}
||
]===])
vim.bo.ft = old_ft vim.bo.ft = old_ft
end) end)

View File

@ -210,6 +210,11 @@ local function eval_stl(stl_expr, width, eval_type)
end end
function M:expect_expr(expect, expr) 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) expect = helpers.dedent(expect)
local actual = eval_stl(expr, self.width, self.type) local actual = eval_stl(expr, self.width, self.type)
local matched = true local matched = true