summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--tests/compile.test6
-rw-r--r--tests/execute.test84
-rw-r--r--tests/expr-old.test108
-rw-r--r--tests/expr.test286
-rw-r--r--tests/parseExpr.test4
-rw-r--r--tests/platform.test6
-rw-r--r--tests/string.test9
8 files changed, 266 insertions, 247 deletions
diff --git a/ChangeLog b/ChangeLog
index f838f25..bf99435 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-11-08 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/compile.test: Updated tests with changed behavior
+ * tests/execute.test: due to addition of bignums.
+ * tests/expr-old.test:
+ * tests/expr.test:
+ * tests/parseExpr.test:
+ * tests/platform.test:
+ * tests/string.test:
+
2005-11-08 Jeff Hobbs <jeffh@ActiveState.com>
* unix/tclUnixFCmd.c (MAX_READDIR_UNLINK_THRESHOLD): reduce to 130
diff --git a/tests/compile.test b/tests/compile.test
index 2ef57a6..b518c37 100644
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: compile.test,v 1.39 2005/10/21 20:44:17 dgp Exp $
+# RCS: @(#) $Id: compile.test,v 1.40 2005/11/09 20:24:10 dgp Exp $
package require tcltest 2
namespace import -force ::tcltest::*
@@ -253,10 +253,10 @@ test compile-11.5 {Tcl_Append*: ensure Tcl_ResetResult is used properly} {
proc p {} { set r [list foobar] ; incr foo }
list [catch {p} msg] $msg
} {1 {can't read "foo": no such variable}}
-test compile-11.6 {Tcl_Append*: ensure Tcl_ResetResult is used properly} knownBug {
+test compile-11.6 {Tcl_Append*: ensure Tcl_ResetResult is used properly} {
proc p {} { set r [list foobar] ; incr foo bogus }
list [catch {p} msg] $msg
-} {1 {expected integer but got "bogus"}}
+} {1 {can't read "foo": no such variable}}
test compile-11.7 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body {
proc p {} { set r [list foobar] ; expr !a }
list [catch {p} msg] $msg
diff --git a/tests/execute.test b/tests/execute.test
index 47bf837..bab3ced 100644
--- a/tests/execute.test
+++ b/tests/execute.test
@@ -14,7 +14,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: execute.test,v 1.20 2005/10/21 21:49:35 dgp Exp $
+# RCS: @(#) $Id: execute.test,v 1.21 2005/11/09 20:24:10 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -592,124 +592,124 @@ test execute-6.2 {Evaluate an expression in a variable; compile the first time,
set res "[a $w]:[a $w]"
} {15:15}
-test execute-7.0 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
+test execute-7.0 {Wide int handling in INST_JUMP_FALSE/LAND} {
set x 0x100000000
expr {$x && 1}
} 1
-test execute-7.1 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
+test execute-7.1 {Wide int handling in INST_JUMP_FALSE/LAND} {
expr {0x100000000 && 1}
} 1
-test execute-7.2 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
+test execute-7.2 {Wide int handling in INST_JUMP_FALSE/LAND} {
expr {1 && 0x100000000}
} 1
-test execute-7.3 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
+test execute-7.3 {Wide int handling in INST_JUMP_FALSE/LAND} {
expr {wide(0x100000000) && 1}
} 1
-test execute-7.4 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
+test execute-7.4 {Wide int handling in INST_JUMP_FALSE/LAND} {
expr {1 && wide(0x100000000)}
} 1
-test execute-7.5 {Wide int handling in INST_EQ} {longIs32bit} {
+test execute-7.5 {Wide int handling in INST_EQ} {
expr {4 == (wide(1)+wide(3))}
} 1
-test execute-7.6 {Wide int handling in INST_EQ and [incr]} {longIs32bit} {
+test execute-7.6 {Wide int handling in INST_EQ and [incr]} {
set x 399999999999
expr {400000000000 == [incr x]}
} 1
# wide ints have more bits of precision than doubles, but we convert anyway
-test execute-7.7 {Wide int handling in INST_EQ and [incr]} {longIs32bit} {
+test execute-7.7 {Wide int handling in INST_EQ and [incr]} {
set x [expr {wide(1)<<62}]
set y [expr {$x+1}]
expr {double($x) == double($y)}
} 1
-test execute-7.8 {Wide int conversions can change sign} {longIs32bit} {
+test execute-7.8 {Wide int conversions can change sign} longIs32bit {
set x 0x80000000
expr {int($x) < wide($x)}
} 1
-test execute-7.9 {Wide int handling in INST_MOD} {longIs32bit} {
+test execute-7.9 {Wide int handling in INST_MOD} {
expr {(wide(1)<<60) % ((wide(47)<<45)-1)}
} 316659348800185
-test execute-7.10 {Wide int handling in INST_MOD} {longIs32bit} {
+test execute-7.10 {Wide int handling in INST_MOD} {
expr {((wide(1)<<60)-1) % 0x400000000}
} 17179869183
-test execute-7.11 {Wide int handling in INST_LSHIFT} {longIs32bit} {
+test execute-7.11 {Wide int handling in INST_LSHIFT} {
expr wide(42)<<30
} 45097156608
-test execute-7.12 {Wide int handling in INST_LSHIFT} {longIs32bit} {
+test execute-7.12 {Wide int handling in INST_LSHIFT} {
expr 12345678901<<3
} 98765431208
-test execute-7.13 {Wide int handling in INST_RSHIFT} {longIs32bit} {
+test execute-7.13 {Wide int handling in INST_RSHIFT} {
expr 0x543210febcda9876>>7
} 47397893236700464
-test execute-7.14 {Wide int handling in INST_RSHIFT} {longIs32bit knownBug} {
- expr 0x9876543210febcda>>7
+test execute-7.14 {Wide int handling in INST_RSHIFT} {
+ expr wide(0x9876543210febcda)>>7
} -58286587177206407
-test execute-7.15 {Wide int handling in INST_BITOR} {longIs32bit knownBug} {
- expr 0x9876543210febcda | 0x543210febcda9876
+test execute-7.15 {Wide int handling in INST_BITOR} {
+ expr wide(0x9876543210febcda) | 0x543210febcda9876
} -2560765885044310786
-test execute-7.16 {Wide int handling in INST_BITXOR} {longIs32bit knownBug} {
- expr 0x9876543210febcda ^ 0x543210febcda9876
+test execute-7.16 {Wide int handling in INST_BITXOR} {
+ expr wide(0x9876543210febcda) ^ 0x543210febcda9876
} -3727778945703861076
-test execute-7.17 {Wide int handling in INST_BITAND} {longIs32bit} {
- expr 0x9876543210febcda & 0x543210febcda9876
+test execute-7.17 {Wide int handling in INST_BITAND} {
+ expr wide(0x9876543210febcda) & 0x543210febcda9876
} 1167013060659550290
-test execute-7.18 {Wide int handling in INST_ADD} {longIs32bit} {
+test execute-7.18 {Wide int handling in INST_ADD} {
expr wide(0x7fffffff)+wide(0x7fffffff)
} 4294967294
-test execute-7.19 {Wide int handling in INST_ADD} {longIs32bit} {
+test execute-7.19 {Wide int handling in INST_ADD} {
expr 0x7fffffff+wide(0x7fffffff)
} 4294967294
-test execute-7.20 {Wide int handling in INST_ADD} {longIs32bit} {
+test execute-7.20 {Wide int handling in INST_ADD} {
expr wide(0x7fffffff)+0x7fffffff
} 4294967294
-test execute-7.21 {Wide int handling in INST_ADD} {longIs32bit} {
+test execute-7.21 {Wide int handling in INST_ADD} {
expr double(0x7fffffff)+wide(0x7fffffff)
} 4294967294.0
-test execute-7.22 {Wide int handling in INST_ADD} {longIs32bit} {
+test execute-7.22 {Wide int handling in INST_ADD} {
expr wide(0x7fffffff)+double(0x7fffffff)
} 4294967294.0
-test execute-7.23 {Wide int handling in INST_SUB} {longIs32bit} {
+test execute-7.23 {Wide int handling in INST_SUB} {
expr 0x123456789a-0x20406080a
} 69530054800
-test execute-7.24 {Wide int handling in INST_MULT} {longIs32bit} {
+test execute-7.24 {Wide int handling in INST_MULT} {
expr 0x123456789a*193
} 15090186251290
-test execute-7.25 {Wide int handling in INST_DIV} {longIs32bit} {
+test execute-7.25 {Wide int handling in INST_DIV} {
expr 0x123456789a/193
} 405116546
-test execute-7.26 {Wide int handling in INST_UPLUS} {longIs32bit} {
+test execute-7.26 {Wide int handling in INST_UPLUS} {
set x 0x123456871234568
expr {+ $x}
} 81985533099853160
-test execute-7.27 {Wide int handling in INST_UMINUS} {longIs32bit} {
+test execute-7.27 {Wide int handling in INST_UMINUS} {
set x 0x123456871234568
expr {- $x}
} -81985533099853160
-test execute-7.28 {Wide int handling in INST_LNOT} {longIs32bit} {
+test execute-7.28 {Wide int handling in INST_LNOT} {
set x 0x123456871234568
expr {! $x}
} 0
-test execute-7.29 {Wide int handling in INST_BITNOT} {longIs32bit} {
+test execute-7.29 {Wide int handling in INST_BITNOT} {
set x 0x123456871234568
expr {~ $x}
} -81985533099853161
-test execute-7.30 {Wide int handling in function call} {longIs32bit} {
+test execute-7.30 {Wide int handling in function call} {
set x 0x12345687123456
incr x
expr {log($x) == log(double($x))}
} 1
-test execute-7.31 {Wide int handling in abs()} {longIs32bit} {
+test execute-7.31 {Wide int handling in abs()} {
set x 0xa23456871234568
incr x
set y 0x123456871234568
concat [expr {abs($x)}] [expr {abs($y)}]
} {730503879441204585 81985533099853160}
-test execute-7.32 {Wide int handling} {longIs32bit knownBug} {
- expr {1024 * 1024 * 1024 * 1024}
+test execute-7.32 {Wide int handling} longIs32bit {
+ expr {int(1024 * 1024 * 1024 * 1024)}
} 0
-test execute-7.33 {Wide int handling} {longIs32bit knownBug} {
- expr {0x1 * 1024 * 1024 * 1024 * 1024}
+test execute-7.33 {Wide int handling} longIs32bit {
+ expr {int(0x1 * 1024 * 1024 * 1024 * 1024)}
} 0
-test execute-7.34 {Wide int handling} {longIs32bit} {
+test execute-7.34 {Wide int handling} {
expr {wide(0x1) * 1024 * 1024 * 1024 * 1024}
} 1099511627776
diff --git a/tests/expr-old.test b/tests/expr-old.test
index 971ea05..e6edcde 100644
--- a/tests/expr-old.test
+++ b/tests/expr-old.test
@@ -13,7 +13,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: expr-old.test,v 1.30 2005/11/01 16:41:20 dgp Exp $
+# RCS: @(#) $Id: expr-old.test,v 1.31 2005/11/09 20:24:10 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2.1
@@ -784,9 +784,9 @@ test expr-old-32.24 {math functions in expressions} {
format %.6g [expr abs(66)]
} {66}
-test expr-old-32.25a {math functions in expressions} knownBug {
- list [catch {expr abs(0x8000000000000000)} msg] $msg
-} {1 {integer value too large to represent}}
+test expr-old-32.25a {math functions in expressions} {
+ expr abs(0x8000000000000000)
+} [expr 1<<63]
test expr-old-32.25b {math functions in expressions} {
expr abs(0x80000000)
@@ -813,12 +813,12 @@ test expr-old-32.31 {math functions in expressions} {
test expr-old-32.32 {math functions in expressions} {
expr int(-1.6)
} {-1}
-test expr-old-32.33 {math functions in expressions} knownBug {
- list [catch {expr int(1e60)} msg] $msg
-} {1 {integer value too large to represent}}
-test expr-old-32.34 {math functions in expressions} knownBug {
- list [catch {expr int(-1e60)} msg] $msg
-} {1 {integer value too large to represent}}
+test expr-old-32.33 {math functions in expressions} {
+ expr int(1e60)
+} 0
+test expr-old-32.34 {math functions in expressions} {
+ expr int(-1e60)
+} 0
test expr-old-32.35 {math functions in expressions} {
expr round(1.49)
} {1}
@@ -831,12 +831,12 @@ test expr-old-32.37 {math functions in expressions} {
test expr-old-32.38 {math functions in expressions} {
expr round(-1.51)
} {-2}
-test expr-old-32.39 {math functions in expressions} knownBug {
- list [catch {expr round(1e60)} msg] $msg
-} {1 {integer value too large to represent}}
-test expr-old-32.40 {math functions in expressions} knownBug {
- list [catch {expr round(-1e60)} msg] $msg
-} {1 {integer value too large to represent}}
+test expr-old-32.39 {math functions in expressions} {
+ expr round(1e60)
+} 999999999999999949387135297074018866963645011013410073083904
+test expr-old-32.40 {math functions in expressions} {
+ expr round(-1e60)
+} -999999999999999949387135297074018866963645011013410073083904
test expr-old-32.41 {math functions in expressions} {
list [catch {expr pow(1.0 + 3.0 - 2, .8 * 5)} msg] $msg
} {0 16.0}
@@ -858,12 +858,12 @@ test expr-old-32.46 {math functions in expressions} -body {
test expr-old-32.47 {math functions in expressions} -body {
list [catch {expr srand()} msg] $msg
} -match glob -result {1 {too few arguments for math function*}}
-test expr-old-32.48 {math functions in expressions} knownBug {
- list [catch {expr srand(3.79)} msg] $msg
-} {1 {can't use floating-point value as argument to srand}}
-test expr-old-32.49 {math functions in expressions} knownBug {
- list [catch {expr srand("")} msg] $msg
-} {1 {argument to math function didn't have numeric value}}
+test expr-old-32.48 {math functions in expressions} -body {
+ expr srand(3.79)
+} -returnCodes error -match glob -result *
+test expr-old-32.49 {math functions in expressions} -body {
+ expr srand("")
+} -returnCodes error -match glob -result *
test expr-old-32.50 {math functions in expressions} {
set result [expr round(srand(12345) * 1000)]
for {set i 0} {$i < 10} {incr i} {
@@ -871,9 +871,9 @@ test expr-old-32.50 {math functions in expressions} {
}
set result
} {97 834 948 36 12 51 766 585 914 784 333}
-test expr-old-32.51 {math functions in expressions} knownBug {
- list [catch {expr {srand([lindex "6ty" 0])}} msg] $msg
-} {1 {argument to math function didn't have numeric value}}
+test expr-old-32.51 {math functions in expressions} -body {
+ expr {srand([lindex "6ty" 0])}
+} -returnCodes error -match glob -result *
test expr-old-32.52 {math functions in expressions} {
expr {srand(int(1<<37)) < 1}
} {1}
@@ -936,24 +936,24 @@ test expr-old-34.12a {errors in math functions} !ieeeFloatingPoint {
test expr-old-34.12b {errors in math functions} ieeeFloatingPoint {
list [catch {expr -14.0*exp(100000)} msg] $msg
} {0 -Inf}
-test expr-old-34.13 {errors in math functions} knownBug {
- list [catch {expr int(1.0e30)} msg] $msg $errorCode
-} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test expr-old-34.14 {errors in math functions} knownBug {
- list [catch {expr int(-1.0e30)} msg] $msg $errorCode
-} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test expr-old-34.15 {errors in math functions} knownBug {
- list [catch {expr round(1.0e30)} msg] $msg $errorCode
-} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test expr-old-34.16 {errors in math functions} knownBug {
- list [catch {expr round(-1.0e30)} msg] $msg $errorCode
-} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
+test expr-old-34.13 {errors in math functions} {
+ expr wide(1.0e30)
+} 5076964154930102272
+test expr-old-34.14 {errors in math functions} {
+ expr wide(-1.0e30)
+} -5076964154930102272
+test expr-old-34.15 {errors in math functions} {
+ expr round(1.0e30)
+} 1000000000000000019884624838656
+test expr-old-34.16 {errors in math functions} {
+ expr round(-1.0e30)
+} -1000000000000000019884624838656
test expr-old-34.17 {errors in math functions} -constraints testmathfunctions \
-body {
list [catch {expr T1(4)} msg] $msg
} -match glob -result {1 {too many arguments for math function*}}
-test expr-old-36.1 {ExprLooksLikeInt procedure} -constraints knownBug -body {
+test expr-old-36.1 {ExprLooksLikeInt procedure} -body {
expr 0289
} -returnCodes error -match glob -result {*invalid octal number*}
test expr-old-36.2 {ExprLooksLikeInt procedure} {
@@ -989,11 +989,11 @@ test expr-old-36.10 {ExprLooksLikeInt procedure} -body {
} -returnCodes error -match glob -result {syntax error in expression "78e"*}
# test for [Bug #542588]
-test expr-old-36.11 {ExprLooksLikeInt procedure} knownBug {
+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 "+"}}
+ expr {$x+1}
+} 665802003400000000000001
# tests for [Bug #587140]
test expr-old-36.12 {ExprLooksLikeInt procedure} {
@@ -1004,18 +1004,18 @@ test expr-old-36.13 {ExprLooksLikeInt procedure} {
set x " +"
list [catch {expr {$x+1}} msg] $msg
} {1 {can't use non-numeric string as operand of "+"}}
-test expr-old-36.14 {ExprLooksLikeInt procedure} knownBug {
+test expr-old-36.14 {ExprLooksLikeInt procedure} {
set x "123456789012345678901234567890 "
- list [catch {expr {$x+1}} msg] $msg
-} {1 {can't use integer value too large to represent as operand of "+"}}
+ expr {$x+1}
+} 123456789012345678901234567891
test expr-old-36.15 {ExprLooksLikeInt procedure} {
set x "099 "
list [catch {expr {$x+1}} msg] $msg
} {1 {can't use invalid octal number as operand of "+"}}
-test expr-old-36.16 {ExprLooksLikeInt procedure} knownBug {
+test expr-old-36.16 {ExprLooksLikeInt procedure} {
set x " 0xffffffffffffffffffffffffffffffffffffff "
- list [catch {expr {$x+1}} msg] $msg
-} {1 {can't use integer value too large to represent as operand of "+"}}
+ expr {$x+1}
+} [expr 0x100000000000000000000000000000000000000]
testConstraint testexprlong [llength [info commands testexprlong]]
testConstraint testexprdouble [llength [info commands testexprdouble]]
@@ -1118,7 +1118,7 @@ test expr-old-37.24 {Tcl_ExprDouble handles overflows that look like int} \
testexprdouble 17976931348623165[string repeat 0 292]
} {This is a result: Inf}
test expr-old-37.25 {Tcl_ExprDouble and NaN} \
- {ieeeFloatingPoint testexprdouble knownBug} {
+ {ieeeFloatingPoint testexprdouble} {
list [catch {testexprdouble 0.0/0.0} result] $result
} {1 {floating point value is Not a Number}}
@@ -1165,9 +1165,9 @@ test expr-old-40.3 {min math function} -body {
test expr-old-40.4 {min math function} -body {
expr {min(wide(-1) << 30, 4.5, -10)}
} -result [expr {wide(-1) << 30}]
-test expr-old-40.5 {min math function} -constraints knownBug -body {
- list [catch {expr {min("a", 0)}} msg] $msg
-} -result {1 {argument to math function didn't have numeric value}}
+test expr-old-40.5 {min math function} -body {
+ expr {min("a", 0)}
+} -returnCodes error -match glob -result *
test expr-old-40.6 {min math function} -body {
expr {min(300, "0xFF")}
} -result 255
@@ -1184,9 +1184,9 @@ test expr-old-41.3 {max math function} -body {
test expr-old-41.4 {max math function} -body {
expr {max(wide(1) << 30, 4.5, -10)}
} -result [expr {wide(1) << 30}]
-test expr-old-41.5 {max math function} -constraints knownBug -body {
- list [catch {expr {max("a", 0)}} msg] $msg
-} -result {1 {argument to math function didn't have numeric value}}
+test expr-old-41.5 {max math function} -body {
+ expr {max("a", 0)}
+} -returnCodes error -match glob -result *
test expr-old-41.6 {max math function} -body {
expr {max(200, "0xFF")}
} -result 255
diff --git a/tests/expr.test b/tests/expr.test
index d3289b8..0b3bfb5 100644
--- a/tests/expr.test
+++ b/tests/expr.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: expr.test,v 1.49 2005/11/08 20:22:03 dgp Exp $
+# RCS: @(#) $Id: expr.test,v 1.50 2005/11/09 20:24:10 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2.1
@@ -445,11 +445,11 @@ test expr-9.1 {CompileRelationalExpr: just shift expr} {expr 3<<2} 12
test expr-9.2 {CompileRelationalExpr: just shift expr} {expr 0xff>>2} 63
test expr-9.3 {CompileRelationalExpr: just shift expr} {expr -1>>2} -1
test expr-9.4 {CompileRelationalExpr: just shift expr} {expr {1<<3}} 8
-test expr-9.5a {CompileRelationalExpr: shift expr producing LONG_MIN} {longIs64bit knownBug} {
- expr {1<<63}
+test expr-9.5a {CompileRelationalExpr: shift expr producing LONG_MIN} longIs64bit {
+ expr {int(1<<63)}
} -9223372036854775808
-test expr-9.5b {CompileRelationalExpr: shift expr producing LONG_MIN} {longIs32bit knownBug} {
- expr {1<<31}
+test expr-9.5b {CompileRelationalExpr: shift expr producing LONG_MIN} longIs32bit {
+ expr {int(1<<31)}
} -2147483648
test expr-9.6 {CompileRelationalExpr: error in shift expr} -body {
catch {expr x>>3} msg
@@ -771,9 +771,15 @@ test expr=15.14 {ExprCallMathFunc: call registered math function} {testmathfunct
test expr-15.15 {ExprCallMathFunc: call registered math function} {testmathfunctions} {
expr T3(21.0, wide(37))
} 37.0
-test expr=15.16 {ExprCallMathFunc: call registered math function} {testmathfunctions} {
+test expr-15.16 {ExprCallMathFunc: call registered math function} {testmathfunctions} {
expr T3(wide(21), 37.0)
} 37.0
+test expr-15.17 {ExprCallMathFunc: non-numeric arg} -constraints {
+ testmathfunctions
+} -body {
+ expr T3(0,"a")
+} -returnCodes error -result {argument to math function didn't have numeric value}
+
test expr-16.1 {GetToken: checks whether integer token starting with "0x" (e.g., "0x$") is invalid} {
catch {unset a}
@@ -1025,10 +1031,10 @@ test expr-24.1 {expr edge cases; shifting} {expr int(5)>>32} 0
test expr-24.2 {expr edge cases; shifting} {expr int(5)>>63} 0
test expr-24.3 {expr edge cases; shifting} {expr wide(5)>>32} 0
test expr-24.4 {expr edge cases; shifting} {expr wide(5)>>63} 0
-test expr-24.5 {expr edge cases; shifting} {longIs32bit knownBug} {expr int(5)<<32} 0
-test expr-24.6 {expr edge cases; shifting} {longIs32bit knownBug} {expr int(5)<<63} 0
+test expr-24.5 {expr edge cases; shifting} longIs32bit {expr int(5<<32)} 0
+test expr-24.6 {expr edge cases; shifting} longIs32bit {expr int(5<<63)} 0
test expr-24.7 {expr edge cases; shifting} {expr wide(5)<<32} 21474836480
-test expr-24.8 {expr edge cases; shifting} knownBug {expr wide(10)<<63} 0
+test expr-24.8 {expr edge cases; shifting} {expr wide(10<<63)} 0
test expr-24.9 {expr edge cases; shifting} {expr 5>>32} 0
# List membership tests
@@ -5405,7 +5411,7 @@ test expr-32.2 {expr div basics} {
-3 -2 -1 -1 -1 \
]
-test expr-33.1 {parse largest long value} {longIs32bit knownBug} {
+test expr-33.1 {parse largest long value} longIs32bit {
set max_long_str 2147483647
set max_long_hex "0x7FFFFFFF "
@@ -5419,10 +5425,10 @@ test expr-33.1 {parse largest long value} {longIs32bit knownBug} {
[expr {$max_long + 0}] \
[expr {2147483647 + 0}] \
[expr {$max_long == $max_long_hex}] \
- [expr {(2147483647 + 1) < 0}] \
+ [expr {int(2147483647 + 1) < 0}] \
} {2147483647 2147483647 2147483647 2147483647 1 1}
-test expr-33.2 {parse smallest long value} {longIs32bit knownBug} {
+test expr-33.2 {parse smallest long value} longIs32bit {
set min_long_str -2147483648
set min_long_hex "-0x80000000 "
@@ -5439,10 +5445,10 @@ test expr-33.2 {parse smallest long value} {longIs32bit knownBug} {
[expr {$min_long + 0}] \
[expr {-2147483648 + 0}] \
[expr {$min_long == $min_long_hex}] \
- [expr {(-2147483648 - 1) == 0x7FFFFFFF}] \
+ [expr {int(-2147483648 - 1) == 0x7FFFFFFF}] \
} {-2147483648 -2147483648 -2147483648 -2147483648 1 1}
-test expr-33.3 {parse largest wide value} {wideIs64bit knownBug} {
+test expr-33.3 {parse largest wide value} wideIs64bit {
set max_wide_str 9223372036854775807
set max_wide_hex "0x7FFFFFFFFFFFFFFF "
@@ -5456,10 +5462,10 @@ test expr-33.3 {parse largest wide value} {wideIs64bit knownBug} {
[expr {$max_wide + 0}] \
[expr {9223372036854775807 + 0}] \
[expr {$max_wide == $max_wide_hex}] \
- [expr {(9223372036854775807 + 1) < 0}] \
+ [expr {wide(9223372036854775807 + 1) < 0}] \
} {9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 1 1}
-test expr-33.4 {parse smallest wide value} {wideIs64bit knownBug} {
+test expr-33.4 {parse smallest wide value} wideIs64bit {
set min_wide_str -9223372036854775808
set min_wide_hex "-0x8000000000000000 "
@@ -5476,351 +5482,351 @@ test expr-33.4 {parse smallest wide value} {wideIs64bit knownBug} {
[expr {$min_wide + 0}] \
[expr {-9223372036854775808 + 0}] \
[expr {$min_wide == $min_wide_hex}] \
- [expr {(-9223372036854775808 - 1) == 0x7FFFFFFFFFFFFFFF}] \
+ [expr {wide(-9223372036854775808 - 1) == 0x7FFFFFFFFFFFFFFF}] \
} {-9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 1 1}
set min -2147483648
set max 2147483647
-test expr-34.1 {expr edge cases} {longIs32bit} {
+test expr-34.1 {expr edge cases} {
expr {$min / $min}
} {1}
-test expr-34.2 {expr edge cases} {longIs32bit} {
+test expr-34.2 {expr edge cases} {
expr {$min % $min}
} {0}
-test expr-34.3 {expr edge cases} {longIs32bit} {
+test expr-34.3 {expr edge cases} {
expr {$min / ($min + 1)}
} {1}
-test expr-34.4 {expr edge cases} {longIs32bit} {
+test expr-34.4 {expr edge cases} {
expr {$min % ($min + 1)}
} {-1}
-test expr-34.5 {expr edge cases} {longIs32bit} {
+test expr-34.5 {expr edge cases} {
expr {$min / ($min + 2)}
} {1}
-test expr-34.6 {expr edge cases} {longIs32bit} {
+test expr-34.6 {expr edge cases} {
expr {$min % ($min + 2)}
} {-2}
-test expr-34.7 {expr edge cases} {longIs32bit} {
+test expr-34.7 {expr edge cases} {
expr {$min / ($min + 3)}
} {1}
-test expr-34.8 {expr edge cases} {longIs32bit} {
+test expr-34.8 {expr edge cases} {
expr {$min % ($min + 3)}
} {-3}
-test expr-34.9 {expr edge cases} {longIs32bit} {
+test expr-34.9 {expr edge cases} {
expr {$min / -3}
} {715827882}
-test expr-34.10 {expr edge cases} {longIs32bit} {
+test expr-34.10 {expr edge cases} {
expr {$min % -3}
} {-2}
-test expr-34.11 {expr edge cases} {longIs32bit} {
+test expr-34.11 {expr edge cases} {
expr {$min / -2}
} {1073741824}
-test expr-34.12 {expr edge cases} {longIs32bit} {
+test expr-34.12 {expr edge cases} {
expr {$min % -2}
} {0}
-test expr-34.13 {expr edge cases} {longIs32bit knownBug} {
- expr {$min / -1}
+test expr-34.13 {expr edge cases} longIs32bit {
+ expr {int($min / -1)}
} {-2147483648}
-test expr-34.14 {expr edge cases} {longIs32bit} {
+test expr-34.14 {expr edge cases} {
expr {$min % -1}
} {0}
-test expr-34.15 {expr edge cases} {longIs32bit knownBug} {
- expr {$min * -1}
+test expr-34.15 {expr edge cases} longIs32bit {
+ expr {int($min * -1)}
} $min
-test expr-34.16 {expr edge cases} {longIs32bit knownBug} {
- expr {-$min}
+test expr-34.16 {expr edge cases} longIs32bit {
+ expr {int(-$min)}
} $min
-test expr-34.17 {expr edge cases} {longIs32bit} {
+test expr-34.17 {expr edge cases} {
expr {$min / 1}
} $min
-test expr-34.18 {expr edge cases} {longIs32bit} {
+test expr-34.18 {expr edge cases} {
expr {$min % 1}
} {0}
-test expr-34.19 {expr edge cases} {longIs32bit} {
+test expr-34.19 {expr edge cases} {
expr {$min / 2}
} {-1073741824}
-test expr-34.20 {expr edge cases} {longIs32bit} {
+test expr-34.20 {expr edge cases} {
expr {$min % 2}
} {0}
-test expr-34.21 {expr edge cases} {longIs32bit} {
+test expr-34.21 {expr edge cases} {
expr {$min / 3}
} {-715827883}
-test expr-34.22 {expr edge cases} {longIs32bit} {
+test expr-34.22 {expr edge cases} {
expr {$min % 3}
} {1}
-test expr-34.23 {expr edge cases} {longIs32bit} {
+test expr-34.23 {expr edge cases} {
expr {$min / ($max - 3)}
} {-2}
-test expr-34.24 {expr edge cases} {longIs32bit} {
+test expr-34.24 {expr edge cases} {
expr {$min % ($max - 3)}
} {2147483640}
-test expr-34.25 {expr edge cases} {longIs32bit} {
+test expr-34.25 {expr edge cases} {
expr {$min / ($max - 2)}
} {-2}
-test expr-34.26 {expr edge cases} {longIs32bit} {
+test expr-34.26 {expr edge cases} {
expr {$min % ($max - 2)}
} {2147483642}
-test expr-34.27 {expr edge cases} {longIs32bit} {
+test expr-34.27 {expr edge cases} {
expr {$min / ($max - 1)}
} {-2}
-test expr-34.28 {expr edge cases} {longIs32bit} {
+test expr-34.28 {expr edge cases} {
expr {$min % ($max - 1)}
} {2147483644}
-test expr-34.29 {expr edge cases} {longIs32bit} {
+test expr-34.29 {expr edge cases} {
expr {$min / $max}
} {-2}
-test expr-34.30 {expr edge cases} {longIs32bit} {
+test expr-34.30 {expr edge cases} {
expr {$min % $max}
} {2147483646}
-test expr-34.31 {expr edge cases} {longIs32bit} {
+test expr-34.31 {expr edge cases} {
expr {$max / $max}
} {1}
-test expr-34.32 {expr edge cases} {longIs32bit} {
+test expr-34.32 {expr edge cases} {
expr {$max % $max}
} {0}
-test expr-34.33 {expr edge cases} {longIs32bit} {
+test expr-34.33 {expr edge cases} {
expr {$max / ($max - 1)}
} {1}
-test expr-34.34 {expr edge cases} {longIs32bit} {
+test expr-34.34 {expr edge cases} {
expr {$max % ($max - 1)}
} {1}
-test expr-34.35 {expr edge cases} {longIs32bit} {
+test expr-34.35 {expr edge cases} {
expr {$max / ($max - 2)}
} {1}
-test expr-34.36 {expr edge cases} {longIs32bit} {
+test expr-34.36 {expr edge cases} {
expr {$max % ($max - 2)}
} {2}
-test expr-34.37 {expr edge cases} {longIs32bit} {
+test expr-34.37 {expr edge cases} {
expr {$max / ($max - 3)}
} {1}
-test expr-34.38 {expr edge cases} {longIs32bit} {
+test expr-34.38 {expr edge cases} {
expr {$max % ($max - 3)}
} {3}
-test expr-34.39 {expr edge cases} {longIs32bit} {
+test expr-34.39 {expr edge cases} {
expr {$max / 3}
} {715827882}
-test expr-34.40 {expr edge cases} {longIs32bit} {
+test expr-34.40 {expr edge cases} {
expr {$max % 3}
} {1}
-test expr-34.41 {expr edge cases} {longIs32bit} {
+test expr-34.41 {expr edge cases} {
expr {$max / 2}
} {1073741823}
-test expr-34.42 {expr edge cases} {longIs32bit} {
+test expr-34.42 {expr edge cases} {
expr {$max % 2}
} {1}
-test expr-34.43 {expr edge cases} {longIs32bit} {
+test expr-34.43 {expr edge cases} {
expr {$max / 1}
} $max
-test expr-34.44 {expr edge cases} {longIs32bit} {
+test expr-34.44 {expr edge cases} {
expr {$max % 1}
} {0}
-test expr-34.45 {expr edge cases} {longIs32bit} {
+test expr-34.45 {expr edge cases} {
expr {$max / -1}
} "-$max"
-test expr-34.46 {expr edge cases} {longIs32bit} {
+test expr-34.46 {expr edge cases} {
expr {$max % -1}
} {0}
-test expr-34.47 {expr edge cases} {longIs32bit} {
+test expr-34.47 {expr edge cases} {
expr {$max / -2}
} {-1073741824}
-test expr-34.48 {expr edge cases} {longIs32bit} {
+test expr-34.48 {expr edge cases} {
expr {$max % -2}
} {-1}
-test expr-34.49 {expr edge cases} {longIs32bit} {
+test expr-34.49 {expr edge cases} {
expr {$max / -3}
} {-715827883}
-test expr-34.50 {expr edge cases} {longIs32bit} {
+test expr-34.50 {expr edge cases} {
expr {$max % -3}
} {-2}
-test expr-34.51 {expr edge cases} {longIs32bit} {
+test expr-34.51 {expr edge cases} {
expr {$max / ($min + 3)}
} {-2}
-test expr-34.52 {expr edge cases} {longIs32bit} {
+test expr-34.52 {expr edge cases} {
expr {$max % ($min + 3)}
} {-2147483643}
-test expr-34.53 {expr edge cases} {longIs32bit} {
+test expr-34.53 {expr edge cases} {
expr {$max / ($min + 2)}
} {-2}
-test expr-34.54 {expr edge cases} {longIs32bit} {
+test expr-34.54 {expr edge cases} {
expr {$max % ($min + 2)}
} {-2147483645}
-test expr-34.55 {expr edge cases} {longIs32bit} {
+test expr-34.55 {expr edge cases} {
expr {$max / ($min + 1)}
} {-1}
-test expr-34.56 {expr edge cases} {longIs32bit} {
+test expr-34.56 {expr edge cases} {
expr {$max % ($min + 1)}
} {0}
-test expr-34.57 {expr edge cases} {longIs32bit} {
+test expr-34.57 {expr edge cases} {
expr {$max / $min}
} {-1}
-test expr-34.58 {expr edge cases} {longIs32bit} {
+test expr-34.58 {expr edge cases} {
expr {$max % $min}
} {-1}
-test expr-34.59 {expr edge cases} {longIs32bit} {
+test expr-34.59 {expr edge cases} {
expr {($min + 1) / ($max - 1)}
} {-2}
-test expr-34.60 {expr edge cases} {longIs32bit} {
+test expr-34.60 {expr edge cases} {
expr {($min + 1) % ($max - 1)}
} {2147483645}
-test expr-34.61 {expr edge cases} {longIs32bit} {
+test expr-34.61 {expr edge cases} {
expr {($max - 1) / ($min + 1)}
} {-1}
-test expr-34.62 {expr edge cases} {longIs32bit} {
+test expr-34.62 {expr edge cases} {
expr {($max - 1) % ($min + 1)}
} {-1}
-test expr-34.63 {expr edge cases} {longIs32bit} {
+test expr-34.63 {expr edge cases} {
expr {($max - 1) / $min}
} {-1}
-test expr-34.64 {expr edge cases} {longIs32bit} {
+test expr-34.64 {expr edge cases} {
expr {($max - 1) % $min}
} {-2}
-test expr-34.65 {expr edge cases} {longIs32bit} {
+test expr-34.65 {expr edge cases} {
expr {($max - 2) / $min}
} {-1}
-test expr-34.66 {expr edge cases} {longIs32bit} {
+test expr-34.66 {expr edge cases} {
expr {($max - 2) % $min}
} {-3}
-test expr-34.67 {expr edge cases} {longIs32bit} {
+test expr-34.67 {expr edge cases} {
expr {($max - 3) / $min}
} {-1}
-test expr-34.68 {expr edge cases} {longIs32bit} {
+test expr-34.68 {expr edge cases} {
expr {($max - 3) % $min}
} {-4}
-test expr-34.69 {expr edge cases} {longIs32bit} {
+test expr-34.69 {expr edge cases} {
expr {-3 / $min}
} {0}
-test expr-34.70 {expr edge cases} {longIs32bit} {
+test expr-34.70 {expr edge cases} {
expr {-3 % $min}
} {-3}
-test expr-34.71 {expr edge cases} {longIs32bit} {
+test expr-34.71 {expr edge cases} {
expr {-2 / $min}
} {0}
-test expr-34.72 {expr edge cases} {longIs32bit} {
+test expr-34.72 {expr edge cases} {
expr {-2 % $min}
} {-2}
-test expr-34.73 {expr edge cases} {longIs32bit} {
+test expr-34.73 {expr edge cases} {
expr {-1 / $min}
} {0}
-test expr-34.74 {expr edge cases} {longIs32bit} {
+test expr-34.74 {expr edge cases} {
expr {-1 % $min}
} {-1}
-test expr-34.75 {expr edge cases} {longIs32bit} {
+test expr-34.75 {expr edge cases} {
expr {0 / $min}
} {0}
-test expr-34.76 {expr edge cases} {longIs32bit} {
+test expr-34.76 {expr edge cases} {
expr {0 % $min}
} {0}
-test expr-34.77 {expr edge cases} {longIs32bit} {
+test expr-34.77 {expr edge cases} {
expr {0 / ($min + 1)}
} {0}
-test expr-34.78 {expr edge cases} {longIs32bit} {
+test expr-34.78 {expr edge cases} {
expr {0 % ($min + 1)}
} {0}
-test expr-34.79 {expr edge cases} {longIs32bit} {
+test expr-34.79 {expr edge cases} {
expr {1 / $min}
} {-1}
-test expr-34.80 {expr edge cases} {longIs32bit} {
+test expr-34.80 {expr edge cases} {
expr {1 % $min}
} {-2147483647}
-test expr-34.81 {expr edge cases} {longIs32bit} {
+test expr-34.81 {expr edge cases} {
expr {1 / ($min + 1)}
} {-1}
-test expr-34.82 {expr edge cases} {longIs32bit} {
+test expr-34.82 {expr edge cases} {
expr {1 % ($min + 1)}
} {-2147483646}
-test expr-34.83 {expr edge cases} {longIs32bit} {
+test expr-34.83 {expr edge cases} {
expr {2 / $min}
} {-1}
-test expr-34.84 {expr edge cases} {longIs32bit} {
+test expr-34.84 {expr edge cases} {
expr {2 % $min}
} {-2147483646}
-test expr-34.85 {expr edge cases} {longIs32bit} {
+test expr-34.85 {expr edge cases} {
expr {2 / ($min + 1)}
} {-1}
-test expr-34.86 {expr edge cases} {longIs32bit} {
+test expr-34.86 {expr edge cases} {
expr {2 % ($min + 1)}
} {-2147483645}
-test expr-34.87 {expr edge cases} {longIs32bit} {
+test expr-34.87 {expr edge cases} {
expr {3 / $min}
} {-1}
-test expr-34.88 {expr edge cases} {longIs32bit} {
+test expr-34.88 {expr edge cases} {
expr {3 % $min}
} {-2147483645}
-test expr-34.89 {expr edge cases} {longIs32bit} {
+test expr-34.89 {expr edge cases} {
expr {3 / ($min + 1)}
} {-1}
-test expr-34.90 {expr edge cases} {longIs32bit} {
+test expr-34.90 {expr edge cases} {
expr {3 % ($min + 1)}
} {-2147483644}
# Euclidean property:
# quotient * divisor + remainder = dividend
-test expr-35.1 {expr edge cases} {longIs32bit} {
+test expr-35.1 {expr edge cases} {
set dividend $max
set divisor 2
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($divisor * $q) + $r}]
} {1073741823 * 2 + 1 = 2147483647}
-test expr-35.2 {expr edge cases} {longIs32bit} {
+test expr-35.2 {expr edge cases} {
set dividend [expr {$max - 1}]
set divisor 2
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {1073741823 * 2 + 0 = 2147483646}
-test expr-35.3 {expr edge cases} {longIs32bit} {
+test expr-35.3 {expr edge cases} {
set dividend [expr {$max - 2}]
set divisor 2
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {1073741822 * 2 + 1 = 2147483645}
-test expr-35.4 {expr edge cases} {longIs32bit} {
+test expr-35.4 {expr edge cases} {
set dividend $max
set divisor 3
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {715827882 * 3 + 1 = 2147483647}
-test expr-35.5 {expr edge cases} {longIs32bit} {
+test expr-35.5 {expr edge cases} {
set dividend [expr {$max - 1}]
set divisor 3
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {715827882 * 3 + 0 = 2147483646}
-test expr-35.6 {expr edge cases} {longIs32bit} {
+test expr-35.6 {expr edge cases} {
set dividend [expr {$max - 2}]
set divisor 3
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {715827881 * 3 + 2 = 2147483645}
-test expr-35.7 {expr edge cases} {longIs32bit} {
+test expr-35.7 {expr edge cases} {
set dividend $min
set divisor 2
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {-1073741824 * 2 + 0 = -2147483648}
-test expr-35.8 {expr edge cases} {longIs32bit} {
+test expr-35.8 {expr edge cases} {
set dividend [expr {$min + 1}]
set divisor 2
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {-1073741824 * 2 + 1 = -2147483647}
-test expr-35.9 {expr edge cases} {longIs32bit} {
+test expr-35.9 {expr edge cases} {
set dividend [expr {$min + 2}]
set divisor 2
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {-1073741823 * 2 + 0 = -2147483646}
-test expr-35.10 {expr edge cases} {longIs32bit} {
+test expr-35.10 {expr edge cases} {
# Two things could happen here. The multiplication
# could overflow a 32 bit type, so that when
# 1 is added it overflows again back to min.
@@ -5833,28 +5839,28 @@ test expr-35.10 {expr edge cases} {longIs32bit} {
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {-715827883 * 3 + 1 = -2147483648}
-test expr-35.11 {expr edge cases} {longIs32bit} {
+test expr-35.11 {expr edge cases} {
set dividend $min
set divisor -3
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {715827882 * -3 + -2 = -2147483648}
-test expr-35.12 {expr edge cases} {longIs32bit} {
+test expr-35.12 {expr edge cases} {
set dividend $min
set divisor $min
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {1 * -2147483648 + 0 = -2147483648}
-test expr-35.13 {expr edge cases} {longIs32bit} {
+test expr-35.13 {expr edge cases} {
set dividend $min
set divisor [expr {$min + 1}]
set q [expr {$dividend / $divisor}]
set r [expr {$dividend % $divisor}]
list $q * $divisor + $r = [expr {($q * $divisor) + $r}]
} {1 * -2147483647 + -1 = -2147483648}
-test expr-35.14 {expr edge cases} {longIs32bit} {
+test expr-35.14 {expr edge cases} {
set dividend $min
set divisor [expr {$min + 2}]
set q [expr {$dividend / $divisor}]
@@ -5903,17 +5909,17 @@ test expr-36.11 {expr edge cases} {wideIs64bit} {
test expr-36.12 {expr edge cases} {wideIs64bit} {
expr {$min % -2}
} {0}
-test expr-36.13 {expr edge cases} {wideIs64bit knownBug} {
- expr {$min / -1}
+test expr-36.13 {expr edge cases} wideIs64bit {
+ expr {wide($min / -1)}
} $min
test expr-36.14 {expr edge cases} {wideIs64bit} {
expr {$min % -1}
} {0}
-test expr-36.15 {expr edge cases} {wideIs64bit knownBug} {
- expr {$min * -1}
+test expr-36.15 {expr edge cases} wideIs64bit {
+ expr {wide($min * -1)}
} $min
-test expr-36.16 {expr edge cases} {wideIs64bit knownBug} {
- expr {-$min}
+test expr-36.16 {expr edge cases} wideIs64bit {
+ expr {wide(-$min)}
} $min
test expr-36.17 {expr edge cases} {wideIs64bit} {
expr {$min / 1}
@@ -6352,7 +6358,7 @@ test expr-39.24 {Tcl_ExprDoubleObj handles overflows that look like int} \
testexprdoubleobj 17976931348623165[string repeat 0 292]
} {This is a result: Inf}
test expr-39.25 {Tcl_ExprDoubleObj and NaN} \
- {testexprdoubleobj ieeeFloatingPoint knownBug} {
+ {testexprdoubleobj ieeeFloatingPoint} {
list [catch {testexprdoubleobj 0.0/0.0} result] $result
} {1 {floating point value is Not a Number}}
@@ -6495,16 +6501,16 @@ test expr-46.3 {round() rounds to +-infinity} {
test expr-46.4 {round() rounds to +-infinity} {
expr round(-1.5)
} -2
-test expr-46.5 {round() overflow} knownBug {
- list [catch {expr round(9.2233720368547758e+018)} result] $result
-} {1 {integer value too large to represent}}
-test expr-46.6 {round() overflow} knownBug {
- list [catch {expr round(-9.2233720368547758e+018)} result] $result
-} {1 {integer value too large to represent}}
-test expr-46.7 {round() bad value} knownBug {
+test expr-46.5 {round() overflow} {
+ expr round(9.2233720368547758e+018)
+} 9223372036854775808
+test expr-46.6 {round() overflow} {
+ expr round(-9.2233720368547758e+018)
+} -9223372036854775808
+test expr-46.7 {round() bad value} -body {
set x trash
- list [catch {expr {round($x)}} result] $result
-} {1 {argument to math function didn't have numeric value}}
+ expr {round($x)}
+} -returnCodes error -match glob -result *
test expr-46.8 {round() already an integer} {
set x 123456789012
incr x
diff --git a/tests/parseExpr.test b/tests/parseExpr.test
index 99f3d07..a397a6b 100644
--- a/tests/parseExpr.test
+++ b/tests/parseExpr.test
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: parseExpr.test,v 1.16 2005/10/21 20:44:20 dgp Exp $
+# RCS: @(#) $Id: parseExpr.test,v 1.17 2005/11/09 20:24:11 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -620,7 +620,7 @@ test parseExpr-16.4 {GetLexeme procedure, integer lexeme} testexprparser {
test parseExpr-16.5 {GetLexeme procedure, integer lexeme too big} {testexprparser wideIs32bit} {
list [catch {testexprparser {12345678901234567890} -1} msg] $msg
} {1 {integer value too large to represent}}
-test parseExpr-16.6 {GetLexeme procedure, bad integer lexeme} -constraints {testexprparser knownBug} -body {
+test parseExpr-16.6 {GetLexeme procedure, bad integer lexeme} -constraints {testexprparser} -body {
testexprparser {0999} -1
} -returnCodes error -match glob -result {*invalid octal number*}
test parseExpr-16.7 {GetLexeme procedure, double lexeme} testexprparser {
diff --git a/tests/platform.test b/tests/platform.test
index c04561e..2236311 100644
--- a/tests/platform.test
+++ b/tests/platform.test
@@ -31,11 +31,11 @@ test platform-1.1 {TclpSetVariables: tcl_platform} {
# everything these days. Note that this does *not* use wide(), and
# this is intentional since that could make Tcl's numbers wider than
# the machine-integer on some platforms...
-test platform-2.1 {tcl_platform(wordSize) indicates size of native word} knownBug {
- set result [expr {1 << (8 * $tcl_platform(wordSize) - 1)}]
+test platform-2.1 {tcl_platform(wordSize) indicates size of native word} {
+ set result [expr {int(1 << (8 * $tcl_platform(wordSize) - 1))}]
# Result must be the largest bit in a machine word, which this checks
# without assuming how wide the word really is
- list [expr {$result < 0}] [expr {$result ^ ($result - 1)}]
+ list [expr {$result < 0}] [expr {$result ^ int($result - 1)}]
} {1 -1}
# On Windows, test that the CPU ID works
diff --git a/tests/string.test b/tests/string.test
index 8de1367..cc43191 100644
--- a/tests/string.test
+++ b/tests/string.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: string.test,v 1.53 2005/10/21 20:44:21 dgp Exp $
+# RCS: @(#) $Id: string.test,v 1.54 2005/11/09 20:24:11 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -406,10 +406,13 @@ test string-6.35 {string is double, false} {
test string-6.36 {string is double, false} {
list [string is double -fail var "\n"] $var
} {0 0}
-test string-6.37 {string is double, false on int overflow} knownBug {
+test string-6.37 {string is double, false on int overflow} {
# Make it the largest int recognizable, with one more digit for overflow
+ # Since bignums arrived in Tcl 8.5, the sense of this test changed.
+ # Now integer values that exceed native limits become bignums, and
+ # bignums can convert to doubles without error.
list [string is double -fail var [largest_int]0] $var
-} {0 -1}
+} {1 0}
# string-6.38 removed, underflow on input is no longer an error.
test string-6.39 {string is double, false} {
# This test is non-portable because IRIX thinks