From 211dfcf14199529e353c08dea10d7050e6a4a22a Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Thu, 11 Jan 2001 17:09:03 +0000 Subject: 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 - 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 --- t/op/ver.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/op/ver.t') 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; -- cgit v1.2.1