diff --git a/palindromes.lua b/palindromes.lua new file mode 100644 index 0000000..e94d656 --- /dev/null +++ b/palindromes.lua @@ -0,0 +1,34 @@ +-- Solution -------------------------------------------------------------------- +function is_palindrome(str) + -- Your implementation here +end + +-- Tests ----------------------------------------------------------------------- + +local luaunit = require("luaunit.luaunit") + +function test_foo_is_not_palindrome() + luaunit.assertFalse(is_palindrome("foo")) +end + +function test_wow_is_palindrome() + luaunit.assertTrue(is_palindrome("wow")) +end + +function test_toast_is_not_palindrome() + luaunit.assertFalse(is_palindrome("toast")) +end + +function test_Racecar_is_palindrome() + luaunit.assertTrue(is_palindrome("Race car")) +end + +function test_Do_geese_see_God_is_palindrome() + luaunit.assertTrue(is_palindrome("Do geese see God?")) +end + +function test_No_lemons_no_melon_is_palindrome() + luaunit.assertTrue(is_palindrome("No lemons, no melon.")) +end + +os.exit(luaunit.LuaUnit.run())