Add lua-format config and auto-format all exercises

This commit is contained in:
2023-12-11 12:11:47 +00:00
parent 467ca0446a
commit 017ef8bac4
9 changed files with 79 additions and 54 deletions

View File

@@ -1,7 +1,6 @@
-- Solution --------------------------------------------------------------------
function is_leap_year(year)
-- Your implementation here
-- Your implementation here
end
-- Tests -----------------------------------------------------------------------
@@ -9,19 +8,19 @@ end
local luaunit = require("luaunit.luaunit")
function test_2004_is_leap_year()
luaunit.assertTrue(is_leap_year(2004))
luaunit.assertTrue(is_leap_year(2004))
end
function test_1993_is_not_leap_year()
luaunit.assertFalse(is_leap_year(1993))
luaunit.assertFalse(is_leap_year(1993))
end
function test_1900_is_not_leap_year()
luaunit.assertFalse(is_leap_year(1900))
luaunit.assertFalse(is_leap_year(1900))
end
function test_2000_is_leap_year()
luaunit.assertTrue(is_leap_year(2000))
luaunit.assertTrue(is_leap_year(2000))
end
os.exit(luaunit.LuaUnit.run())