tcltest: do a better job of cleanup up after tests
[jimtcl.git] / tests / expr-base.test
blob5c9e1da9c32fb4fac519c8cff75d41bdc90085c4
1 source [file dirname [info script]]/testing.tcl
3 # Test number detection
4 set good_testcases {
5         0                       0
6         1                       1
7         8                       8
8         00                      0
9         07                      7
10         08                      8
11         0x5                     5
12         0x0                     0
13         0x00            0
14         -0x5            -5
15         0b111           7
16         -0b111          -7
17         -0B101          -5
18         0o7                     7
21 set i 0
22 foreach {str exp} $good_testcases {
23         test expr-base-1.[incr i] "expr conversion" [list expr [list $str]] $exp
26 set bad_testcases {
27         {0x + 1}
28         x
29         0xx5
30         0x-5
31         {0x 5}
32         {0o8 + 1}
35 set i 0
36 foreach str $bad_testcases {
37         test expr-base-2.[incr i] "expr conversion failure" -returnCodes error -body [list expr $str] -match glob -result "*"
39 testreport