summaryrefslogtreecommitdiffstats
path: root/tests/util.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-14 14:14:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-14 14:14:17 (GMT)
commit82d0258052c45ac6767727539635540dc724182c (patch)
tree963258bf47328b692d688313d05078fc454802c3 /tests/util.test
parent9a259b172375b510de40955def893799c4359cf2 (diff)
downloadtcl-82d0258052c45ac6767727539635540dc724182c.zip
tcl-82d0258052c45ac6767727539635540dc724182c.tar.gz
tcl-82d0258052c45ac6767727539635540dc724182c.tar.bz2
Implement all possible TCL_LL_MODIFIER formats in Tcl_ObjPrintf(), can be "ll", "I64" and "L", whatever the platform defines for long long integer. With test-cases.jn_wide_printf
Diffstat (limited to 'tests/util.test')
-rw-r--r--tests/util.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/util.test b/tests/util.test
index 2ac11bf..1a3eecb 100644
--- a/tests/util.test
+++ b/tests/util.test
@@ -20,6 +20,7 @@ testConstraint testbytestring [llength [info commands testbytestring]]
testConstraint testdstring [llength [info commands testdstring]]
testConstraint testconcatobj [llength [info commands testconcatobj]]
testConstraint testdoubledigits [llength [info commands testdoubledigits]]
+testConstraint testprint [llength [info commands testprint]]
# Big test for correct ordering of data in [expr]
@@ -4017,6 +4018,30 @@ test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} {
0x4400000000000000 0xc400000000000000
}]
+test util-18.1 {Tcl_ObjPrintf} {testprint} {
+ testprint %lld [expr 2**63-1]
+} {9223372036854775807}
+
+test util-18.2 {Tcl_ObjPrintf} {testprint} {
+ testprint %I64d [expr 2**63-1]
+} {9223372036854775807}
+
+test util-18.3 {Tcl_ObjPrintf} {testprint} {
+ testprint %Ld [expr 2**63-1]
+} {9223372036854775807}
+
+test util-18.4 {Tcl_ObjPrintf} {testprint} {
+ testprint %lld [expr -2**63]
+} {-9223372036854775808}
+
+test util-18.5 {Tcl_ObjPrintf} {testprint} {
+ testprint %I64d [expr -2**63]
+} {-9223372036854775808}
+
+test util-18.6 {Tcl_ObjPrintf} {testprint} {
+ testprint %Ld [expr -2**63]
+} {-9223372036854775808}
+
set ::tcl_precision $saved_precision
# cleanup