35 lines
868 B
Lua
35 lines
868 B
Lua
-- 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())
|