diff --git a/basic/leap_year.lua b/basic/leap_year.lua new file mode 100644 index 0000000..582e9fb --- /dev/null +++ b/basic/leap_year.lua @@ -0,0 +1,26 @@ +function leap_year(year) + -- Your solution here +end + +-- Tests ----------------------------------------------------------------------- + +package.path = package.path .. ";../luaunit/?.lua" +local luaunit = require("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())