refactor: format test/*

This commit is contained in:
Justin M. Keyes
2024-01-03 02:09:18 +01:00
parent 59d117ec99
commit 04f2f864e2
363 changed files with 30631 additions and 20833 deletions

View File

@@ -5,8 +5,7 @@ local clear = helpers.clear
local command = helpers.command
local feed = helpers.feed
describe("update_menu notification", function()
describe('update_menu notification', function()
local screen
before_each(function()
@@ -16,23 +15,26 @@ describe("update_menu notification", function()
end)
local function expect_sent(expected)
screen:expect{condition=function()
if screen.update_menu ~= expected then
if expected then
error('update_menu was expected but not sent')
else
error('update_menu was sent unexpectedly')
screen:expect {
condition = function()
if screen.update_menu ~= expected then
if expected then
error('update_menu was expected but not sent')
else
error('update_menu was sent unexpectedly')
end
end
end
end, unchanged=(not expected)}
end,
unchanged = not expected,
}
end
it("should be sent when adding a menu", function()
it('should be sent when adding a menu', function()
command('menu Test.Test :')
expect_sent(true)
end)
it("should be sent when deleting a menu", function()
it('should be sent when deleting a menu', function()
command('menu Test.Test :')
screen.update_menu = false
@@ -40,9 +42,8 @@ describe("update_menu notification", function()
expect_sent(true)
end)
it("should not be sent unnecessarily", function()
it('should not be sent unnecessarily', function()
feed('i12345<ESC>:redraw<CR>')
expect_sent(false)
end)
end)