diff options
Diffstat (limited to 'tests/compExpr-old.test')
-rw-r--r-- | tests/compExpr-old.test | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/compExpr-old.test b/tests/compExpr-old.test index 6ac7ff1..f13e0e9 100644 --- a/tests/compExpr-old.test +++ b/tests/compExpr-old.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: compExpr-old.test,v 1.12 2005/05/10 18:35:17 kennykb Exp $ +# RCS: @(#) $Id: compExpr-old.test,v 1.13 2005/07/28 18:42:28 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -125,7 +125,9 @@ proc do_twelve_days {} { global xxx set xxx "" 12days 1 1 1 - string length $xxx + set result [string length $xxx] + unset xxx + return $result } # start of tests @@ -216,16 +218,12 @@ test compExpr-old-3.6 {CompileCondExpr: error compiling false arm} { catch {expr 2>3?44:2***3} msg set msg } {syntax error in expression "2>3?44:2***3": unexpected operator *} -test compExpr-old-3.7 {CompileCondExpr: long arms & nested cond exprs} {nonPortable} { - puts "Note: doing test compExpr-old-3.7 which can take several minutes to run" +test compExpr-old-3.7 {CompileCondExpr: long arms & nested cond exprs} { hello_world } {Hello world} -catch {unset xxx} -test compExpr-old-3.8 {CompileCondExpr: long arms & nested cond exprs} {nonPortable} { - puts "Note: doing test compExpr-old-3.8 which can take several minutes to run" +test compExpr-old-3.8 {CompileCondExpr: long arms & nested cond exprs} { do_twelve_days } 2358 -catch {unset xxx} test compExpr-old-4.1 {CompileLorExpr: just land expr} {expr 1.3&&3.3} 1 test compExpr-old-4.2 {CompileLorExpr: error in land expr} -body { @@ -359,15 +357,17 @@ test compExpr-old-9.4 {CompileRelationalExpr: just shift expr} {expr {1<<3}} 8 # The following test is different for 32-bit versus 64-bit # architectures because LONG_MIN is different -if {int(0x80000000) > 0} { - test compExpr-old-9.5 {CompileRelationalExpr: shift expr producing LONG_MIN} {nonPortable} { - expr {1<<63} - } -9223372036854775808 -} else { - test compExpr-old-9.5 {CompileRelationalExpr: shift expr producing LONG_MIN} {nonPortable} { - expr {1<<31} - } -2147483648 -} +testConstraint longIs32bit [expr {int(0x80000000) < 0}] +testConstraint longIs64bit [expr {int(0x8000000000000000) < 0}] + +test compExpr-old-9.5a {CompileRelationalExpr: shift expr producing LONG_MIN} longIs64bit { + expr {1<<63} +} -9223372036854775808 + +test compExpr-old-9.5b {CompileRelationalExpr: shift expr producing LONG_MIN} longIs32bit { + expr {1<<31} +} -2147483648 + test compExpr-old-9.6 {CompileRelationalExpr: error in shift expr} -body { catch {expr x>>3} msg set msg |