summaryrefslogtreecommitdiffstats
path: root/tests/format.test
diff options
context:
space:
mode:
authorrmax <rmax@noemail.net>2008-04-07 15:23:04 (GMT)
committerrmax <rmax@noemail.net>2008-04-07 15:23:04 (GMT)
commitb373c789a00835fb7319ce7d8ed392d47634ce5a (patch)
tree977c901d0fab00597fe986e630e23630f418d622 /tests/format.test
parentcc77a9a89ff72abb1cead553ff17104b934ffb29 (diff)
downloadtcl-b373c789a00835fb7319ce7d8ed392d47634ce5a.zip
tcl-b373c789a00835fb7319ce7d8ed392d47634ce5a.tar.gz
tcl-b373c789a00835fb7319ce7d8ed392d47634ce5a.tar.bz2
* generic/tclStringObj.c (Tcl_AppendFormatToObj):
Fix [format {% d}] so that it behaves the same way as in 8.4 and as C's printf(). * tests/format.test: Add a test for '% d' and '%+d'. FossilOrigin-Name: 0b371e1c321a8415fa8a0c5eeaa71595273a2110
Diffstat (limited to 'tests/format.test')
-rw-r--r--tests/format.test8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/format.test b/tests/format.test
index b050fc3..a985eeb 100644
--- a/tests/format.test
+++ b/tests/format.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: format.test,v 1.25 2008/01/10 16:09:23 dgp Exp $
+# RCS: @(#) $Id: format.test,v 1.26 2008/04/07 15:23:11 rmax Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -496,6 +496,12 @@ test format-15.3 {testing %0..s 0 padding for chars/strings} {
test format-15.4 {testing %0..s 0 padding for chars/strings} {
format %05c 61
} {0000=}
+test format-15.5 {testing %d space padding for integers} {
+ format "(% 1d) (% 1d)" 10 -10
+} {( 10) (-10)}
+test format-15.6 {testing %d plus padding for integers} {
+ format "(%+1d) (%+1d)" 10 -10
+} {(+10) (-10)}
set a "0123456789"
set b ""