summaryrefslogtreecommitdiffstats
path: root/tests/expr.test
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-08-05 19:19:01 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-08-05 19:19:01 (GMT)
commit629d47ebdf3e2e61877521651486796053e0693b (patch)
treed5cde9c6342d799dd709df022d80ecd665932579 /tests/expr.test
parent724f38841e77cbc6d775b8f7fc594910ea1f7413 (diff)
downloadtcl-629d47ebdf3e2e61877521651486796053e0693b.zip
tcl-629d47ebdf3e2e61877521651486796053e0693b.tar.gz
tcl-629d47ebdf3e2e61877521651486796053e0693b.tar.bz2
fix abs(MIN_INT) [Bug 1241572]
Diffstat (limited to 'tests/expr.test')
-rw-r--r--tests/expr.test8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test
index 6ba6732..b3707b8 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.17.2.4 2004/11/02 15:46:35 dkf Exp $
+# RCS: @(#) $Id: expr.test,v 1.17.2.5 2005/08/05 19:19:14 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -21,6 +21,7 @@ testConstraint registeredMathFuncs [expr {
([catch {expr T1()} msg] != 1) || ($msg ne {unknown math function "T1"})
}]
+testConstraint wideIs64bit [expr {(0x80000000 > 0) && (0x8000000000000000 < 0)}]
# procedures used below
proc put_hello_char {c} {
@@ -822,6 +823,11 @@ test expr-24.7 {expr edge cases; shifting} {expr wide(5)<<31} 10737418240
test expr-24.8 {expr edge cases; shifting} nonPortable {expr wide(5)<<63} -9223372036854775808
test expr-24.9 {expr edge cases; shifting} {expr 5>>32} 0
+test expr-38.1 {abs of smallest 32-bit integer [Bug 1241572]} {wideIs64bit} {
+ expr {abs(int(-2147483648))}
+} 2147483648
+
+
# cleanup
if {[info exists a]} {
unset a