RosettaCodeData/Task/Test-a-function/Tcl/test-a-function.tcl

15 lines
495 B
Tcl
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
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