puts stdout "not ok $test_count $reason"
}
+ proc ok {cond reason} {
+ if $cond {
+ pass $reason
+ } else {
+ fail "$reason: $cond false"
+ }
+ }
+
+ proc cmp_ok {op left right reason} {
+ if [expr $left $op $right] {
+ pass $reason
+ } else {
+ fail "$reason: $left $op $right false"
+ }
+ }
+
proc is {left right reason} {
switch $left \
$right { pass $reason } \
- default { fail "$reason: expected $left, got $right" }
+ default { fail "$reason: expected $right, got $left" }
}
proc done_testing {} {
puts stdout "1..$test_count"
}
- namespace export pass fail is done_testing
+ namespace export pass fail is ok cmp_ok done_testing
}
package provide ten::test 0.0.1