c5774944f60590ad33b892acb9d443e24ef1fce2
[scpubgit/TenDotTcl.git] / ten / test.tcl
1 namespace eval ::ten::test:: {
2
3   variable test_count 0
4
5   proc pass {reason} {
6     variable test_count
7     incr test_count
8     puts stdout "ok $test_count $reason"
9   }
10
11   proc fail {reason} {
12     variable test_count
13     incr test_count
14     puts stdout "not ok $test_count $reason"
15   }
16
17   proc is {left right reason} {
18     switch $left \
19       $right { pass $reason } \
20       default { fail "$reason: expected $left, got $right" }
21   }
22
23   proc done_testing {} {
24     variable test_count
25     puts stdout "1..$test_count"
26   }
27
28   namespace export pass fail is done_testing
29 }
30
31 package provide ten::test 0.0.1