diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 12:05:36 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:44 +1000 |
commit | a7335808c5725934d81dbe68247b62a6ab08bf2f (patch) | |
tree | de45f62dacf49ebabc9b89a441b6d8c3e8f14256 /tests/expr-old.test | |
parent | a17425e476861fde1e1ad824181f97e081740659 (diff) | |
download | jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.zip jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.tar.gz jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.tar.bz2 |
More expr tests and fixes
*: Add tests/expr-new.test from Tcl
*: Directly convert from int to double if possible
*: Always treat '-' in front of a number as unary minus
so that '-0x1234' works.
*: Fix expr when the variable does not exist
*: Add optional support for math functions
*: Also double/0 == Inf or -Inf
Diffstat (limited to 'tests/expr-old.test')
-rw-r--r-- | tests/expr-old.test | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/expr-old.test b/tests/expr-old.test index 41c6139..d038144 100644 --- a/tests/expr-old.test +++ b/tests/expr-old.test @@ -432,8 +432,8 @@ test expr-old-26.9 {error conditions} { list [catch {expr 2%0} msg] } {1} test expr-old-26.10 {error conditions} { - list [catch {expr 2.0/0.0} msg] -} {1} + expr 2.0/0.0 +} {Inf} test expr-old-26.11 {error conditions} { list [catch {expr 2#} msg] } {1} @@ -814,11 +814,12 @@ test expr-old-36.10 {ExprLooksLikeInt procedure} { } # test for [Bug #542588] -test expr-old-36.11 {ExprLooksLikeInt procedure} { - # define a "too large integer"; this one works also for 64bit arith - set x 665802003400000000000000 - list [catch {expr {$x+1}} msg] $msg -} {1 {can't use integer value too large to represent as operand of "+"}} +# XXX: Can't rely on overflow checking +#test expr-old-36.11 {ExprLooksLikeInt procedure} { +# # define a "too large integer"; this one works also for 64bit arith +# set x 665802003400000000000000 +# list [catch {expr {$x+1}} msg] $msg +#} {1 {can't use integer value too large to represent as operand of "+"}} # Special test for Pentium arithmetic bug of 1994: |