diff options
author | Hugo van der Sanden <hv@crypt.org> | 2001-01-11 17:09:03 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-01-19 14:41:24 +0000 |
commit | 211dfcf14199529e353c08dea10d7050e6a4a22a (patch) | |
tree | 409f19012b858417450e93ece66ada0ef6dd1775 /t/op/ver.t | |
parent | db4b74455a92b07df967acd6d937f841399044da (diff) | |
download | perl-211dfcf14199529e353c08dea10d7050e6a4a22a.tar.gz |
Re: new feature: s?printf parameter reordering
Message-Id: <200101111709.RAA23756@crypt.compulink.co.uk>
- support reordering for all parameters: %, *v, *, .*
- lay down that the reordering specification must immediately
follow that parameter: %3$, *v3$, *3$, .*3$
- fix vectorisation of a zero-length string
- factor out the code choosing the argument to format
Possibly unwanted side-effects:
- the special format specifiers ' +-0' must now precede any
vectorisation specifier. Tests in op/sprintf and op/ver
have been changed to reflect this.
- sprintf.t test #214 changed its expectations because in many
cases, the next parameter has already been consumed when an
invalid type letter is detected.
Probably wanted side-effects:
- attempts to format a non-existent parameter will warn as if C<undef>
- attempt to write to non-existent parameter with '%n' will complain
of "attempt to modify read-only value" instead of being silent
p4raw-id: //depot/perl@8481
Diffstat (limited to 't/op/ver.t')
-rwxr-xr-x | t/op/ver.t | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/op/ver.t b/t/op/ver.t index edfebd20ff..b9ba5891f0 100755 --- a/t/op/ver.t +++ b/t/op/ver.t @@ -102,10 +102,10 @@ print "not " unless sprintf("%vX", 1.22.333.4444) eq '1.16.14D.115C'; print "ok $test\n"; ++$test; if (ord("\t") == 9) { # ASCII - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0120:0145:0162:0154'; } else { - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0327:0205:0231:0223'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0327:0205:0231:0223'; } print "ok $test\n"; ++$test; @@ -144,10 +144,10 @@ print "ok $test\n"; ++$test; print "ok $test\n"; ++$test; if (ord("\t") == 9) { # ASCII - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0120:0145:0162:0154'; } else { - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0327:0205:0231:0223'; + print "not " unless sprintf("%#*vo", ":", "Perl") eq '0327:0205:0231:0223'; } print "ok $test\n"; ++$test; |