

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.



package require tcltest 2
source palindrome.tcl; # Assume that this is what loads the implementation of ‘palindrome’
 
tcltest::test palindrome-1 {check for palindromicity} -body {
    palindrome abcdedcba
} -result 1
tcltest::test palindrome-2 {check for non-palindromicity} -body {
    palindrome abcdef
} -result 0
tcltest::test palindrome-3 {check for palindrome error} -body {
    palindrome
} -returnCodes error -result "wrong # args: should be \"palindrome s\""
 
tcltest::cleanupTests