

Task

Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome.

If your language does not have a testing specific library well known to the language's community then state this or omit the language.



// version 1.1.3
 
fun isPalindrome(s: String) = (s == s.reversed())
 
fun main(args: Array<String>) {
    val testCases = listOf("racecar", "alice", "eertree", "david")
    for (testCase in testCases) {
        try {
            assert(isPalindrome(testCase)) { "$testCase is not a palindrome" }
        }
        catch (ae: AssertionError) {
            println(ae.message)
        }
    }
}