summaryrefslogtreecommitdiffstats
path: root/tests/expr.test
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2005-11-08 20:22:02 (GMT)
committerdgp <dgp@noemail.net>2005-11-08 20:22:02 (GMT)
commitcf6d3d4cdcafdc1359b73b06c0729010a6b557b6 (patch)
tree7d8182f8453ba7b12f299b99e8c2be13b3ad593c /tests/expr.test
parent2c8cd0222d0ca334c0a66e377bc9f03d346599e8 (diff)
downloadtcl-cf6d3d4cdcafdc1359b73b06c0729010a6b557b6.zip
tcl-cf6d3d4cdcafdc1359b73b06c0729010a6b557b6.tar.gz
tcl-cf6d3d4cdcafdc1359b73b06c0729010a6b557b6.tar.bz2
* tests/expr.test: Portable tests expr-46.13-18 [Bug 1341368]
FossilOrigin-Name: 1523bbef0905f7daa4b950710faa4e64fdc9847c
Diffstat (limited to 'tests/expr.test')
-rw-r--r--tests/expr.test28
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/expr.test b/tests/expr.test
index 876fce2..d3289b8 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.48 2005/11/01 15:18:27 dgp Exp $
+# RCS: @(#) $Id: expr.test,v 1.49 2005/11/08 20:22:03 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2.1
@@ -6554,10 +6554,34 @@ test expr-46.12 {round() boundary case - -1/2 + 1 ulp} {
}
expr {round($x)}
} 0
-test expr-46.13 {round() handling of long/bignum boundary} {
+test expr-46.13 {round() boundary case - round down} {
+ expr {round(2147483647 - 0.51)}
+} 2147483646
+
+test expr-46.14 {round() boundary case - round up} {
+ expr {round(2147483647 - 0.50)}
+} 2147483647
+
+test expr-46.15 {round() boundary case - round up to wide} {
+ expr {round(2147483647 + 0.50)}
+} [expr {wide(2147483647) + 1}]
+
+test expr-46.16 {round() boundary case - round up} {
+ expr {round(-2147483648 + 0.51)}
+} -2147483647
+
+test expr-46.17 {round() boundary case - round down} {
+ expr {round(-2147483648 + 0.50)}
+} -2147483648
+test expr-46.18 {round() boundary case - round down to wide} {
+ expr {round(-2147483648 - 0.50)}
+} [expr {wide(-2147483648) - 1}]
+
+test expr-46.19 {round() handling of long/bignum boundary} {
expr {round(double(0x7fffffffffffffff))}
} 9223372036854775808
+
# cleanup
if {[info exists a]} {
unset a