diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-06-22 08:15:13 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-06-22 08:15:13 (GMT) |
commit | 45175dd2641f3979ab0e3a6b5b527a9cf5bab902 (patch) | |
tree | 2fdbe8d96b8bd430d6c834bf6ab118383db11de1 | |
parent | c488b70a470394ba33b4be54a944d95e4ce27b6c (diff) | |
download | tcl-45175dd2641f3979ab0e3a6b5b527a9cf5bab902.zip tcl-45175dd2641f3979ab0e3a6b5b527a9cf5bab902.tar.gz tcl-45175dd2641f3979ab0e3a6b5b527a9cf5bab902.tar.bz2 |
Add test-cases, testing the legacy behavior of "format %#d"
-rw-r--r-- | doc/GetInt.3 | 2 | ||||
-rw-r--r-- | tests/format.test | 19 | ||||
-rw-r--r-- | tests/util.test | 6 |
3 files changed, 23 insertions, 4 deletions
diff --git a/doc/GetInt.3 b/doc/GetInt.3 index 3e7204c..5a3304a 100644 --- a/doc/GetInt.3 +++ b/doc/GetInt.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetInt 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/tests/format.test b/tests/format.test index 9afedd9..2795ac2 100644 --- a/tests/format.test +++ b/tests/format.test @@ -78,6 +78,25 @@ test format-1.11.1 {integer formatting} longIs64bit { test format-1.12 {integer formatting} { format "%b %#b %#b %llb" 5 0 5 [expr {2**100}] } {101 0b0 0b101 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} +test format-1.13 {integer formatting} longIs32bit { + format "%#d %#d %#d %#d %#d" 0 6 34 16923 -12 -1 +} {0 6 34 16923 -12} +test format-1.13.1 {integer formatting} longIs64bit { + format "%#d %#d %#d %#d %#d" 0 6 34 16923 -12 -1 +} {0 6 34 16923 -12} +test format-1.14 {integer formatting} longIs32bit { + format "%#5d %#20d %#20d %#20d %#20d" 0 6 34 16923 -12 -1 +} { 0 6 34 16923 -12} +test format-1.14.1 {integer formatting} longIs64bit { + format "%#5d %#20d %#20d %#20d %#20d" 0 6 34 16923 -12 -1 +} { 0 6 34 16923 -12} +test format-1.15 {integer formatting} longIs32bit { + format "%-#5d %-#20d %-#20d %-#20d %-#20d" 0 6 34 16923 -12 -1 +} {0 6 34 16923 -12 } +test format-1.15.1 {integer formatting} longIs64bit { + format "%-#5d %-#20d %-#20d %-#20d %-#20d" 0 6 34 16923 -12 -1 +} {0 6 34 16923 -12 } + test format-2.1 {string formatting} { format "%s %s %c %s" abcd {This is a very long test string.} 120 x diff --git a/tests/util.test b/tests/util.test index 7782f35..2ac11bf 100644 --- a/tests/util.test +++ b/tests/util.test @@ -208,7 +208,7 @@ test util-4.6 {Tcl_ConcatObj - utf-8 sequence with "whitespace" char} { } \xe0 test util-4.7 {Tcl_ConcatObj - refCount safety} testconcatobj { # Check for Bug #1447328 (actually, bugs in its original "fix"). One of the - # symptoms was Bug #2055782. + # symptoms was Bug #2055782. testconcatobj } {} @@ -566,7 +566,7 @@ test util-9.1.3 {TclGetIntForIndex} { } k test util-9.2.0 {TclGetIntForIndex} { string index abcd end -} d +} d test util-9.2.1 {TclGetIntForIndex} -body { string index abcd { end} } -returnCodes error -match glob -result * @@ -4007,7 +4007,7 @@ test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} { } set r } [list {*}{ - 0x43fffffffffffffc 0xc3fffffffffffffc + 0x43fffffffffffffc 0xc3fffffffffffffc 0x43fffffffffffffc 0xc3fffffffffffffc 0x43fffffffffffffd 0xc3fffffffffffffd 0x43fffffffffffffe 0xc3fffffffffffffe |