Enumerate exercises and add 'Solution' headings

This commit is contained in:
2023-10-15 14:59:02 +01:00
parent 37c911fa60
commit eecd8f6dc9
3 changed files with 9 additions and 3 deletions

27
001_leap_year.lua Normal file
View File

@@ -0,0 +1,27 @@
-- Solution --------------------------------------------------------------------
function leap_year(year)
-- Your implementation here
end
-- Tests -----------------------------------------------------------------------
local luaunit = require("luaunit.luaunit")
function test_2004_is_leap_year()
luaunit.assertTrue(leap_year(2004))
end
function test_1993_is_not_leap_year()
luaunit.assertFalse(leap_year(1993))
end
function test_1900_is_not_leap_year()
luaunit.assertFalse(leap_year(1900))
end
function test_2000_is_leap_year()
luaunit.assertTrue(leap_year(2000))
end
os.exit(luaunit.LuaUnit.run())