This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [perl #37897] sprintf of version objects
[perl5.git] / t / op / sprintf.t
CommitLineData
8d063cd8
LW
1#!./perl
2
be3174d2
GS
3# Tests sprintf, excluding handling of 64-bit integers or long
4# doubles (if supported), of machine-specific short and long
5# integers, machine-specific floating point exceptions (infinity,
6# not-a-number ...), of the effects of locale, and of features
169da838 7# specific to multi-byte characters (under the utf8 pragma and such).
8d063cd8 8
9f1b1f2d
GS
9BEGIN {
10 chdir 't' if -d 't';
20822f61 11 @INC = '../lib';
e24bffee 12}
9f1b1f2d 13use warnings;
e24bffee 14use Config;
0a52d15b 15use strict;
8234e14b 16
8234e14b
PP
17my @tests = ();
18my ($i, $template, $data, $result, $comment, $w, $x, $evalData, $n, $p);
9f1b1f2d 19
8234e14b 20my $Is_VMS_VAX = 0;
2fba3065
PP
21# We use HW_MODEL since ARCH_NAME was not in VMS V5.*
22if ($^O eq 'VMS') {
23 my $hw_model;
24 chomp($hw_model = `write sys\$output f\$getsyi("HW_MODEL")`);
25 $Is_VMS_VAX = $hw_model < 1024 ? 1 : 0;
8234e14b
PP
26}
27
eaf637cf
JH
28# No %Config.
29my $Is_Ultrix_VAX = $^O eq 'ultrix' && `uname -m` =~ /^VAX$/;
30
0a52d15b
NC
31while (<DATA>) {
32 s/^\s*>//; s/<\s*$//;
33 ($template, $data, $result, $comment) = split(/<\s*>/, $_, 4);
e95e2653 34 if ($^O eq 'os390' || $^O eq 's390') { # non-IEEE (s390 is UTS)
12ebcc11
PP
35 $data =~ s/([eE])96$/${1}63/; # smaller exponents
36 $result =~ s/([eE]\+)102$/${1}69/; # " "
37 $data =~ s/([eE])\-101$/${1}-56/; # larger exponents
38 $result =~ s/([eE])\-102$/${1}-57/; # " "
39 }
eaf637cf 40 if ($Is_VMS_VAX || $Is_Ultrix_VAX) {
e24bffee 41 # VAX DEC C 5.3 at least since there is no
eaf637cf
JH
42 # ccflags =~ /float=ieee/ on VAX.
43 # AXP is unaffected whether or not it's using ieee.
8234e14b
PP
44 $data =~ s/([eE])96$/${1}26/; # smaller exponents
45 $result =~ s/([eE]\+)102$/${1}32/; # " "
46 $data =~ s/([eE])\-101$/${1}-24/; # larger exponents
47 $result =~ s/([eE])\-102$/${1}-25/; # " "
48 }
57c348a9
NC
49
50 $evalData = eval $data;
51 $data = ref $evalData ? $evalData : [$evalData];
0a52d15b
NC
52 push @tests, [$template, $data, $result, $comment];
53}
54
55print '1..', scalar @tests, "\n";
56
57$SIG{__WARN__} = sub {
58 if ($_[0] =~ /^Invalid conversion/) {
59 $w = ' INVALID';
60 } elsif ($_[0] =~ /^Use of uninitialized value/) {
61 $w = ' UNINIT';
62 } else {
63 warn @_;
64 }
65};
66
67for ($i = 1; @tests; $i++) {
68 ($template, $data, $result, $comment) = @{shift @tests};
be3174d2 69 $w = undef;
57c348a9 70 $x = sprintf(">$template<", @$data);
be3174d2 71 substr($x, -1, 0) = $w if $w;
48237dde
GS
72 # $x may have 3 exponent digits, not 2
73 my $y = $x;
74 if ($y =~ s/([Ee][-+])0(\d)/$1$2/) {
75 # if result is left-adjusted, append extra space
76 if ($template =~ /%\+?\-/ and $result =~ / $/) {
77 $y =~ s/<$/ </;
78 }
79 # if result is zero-filled, add extra zero
80 elsif ($template =~ /%\+?0/ and $result =~ /^0/) {
81 $y =~ s/^>0/>00/;
82 }
83 # if result is right-adjusted, prepend extra space
84 elsif ($result =~ /^ /) {
85 $y =~ s/^>/> /;
86 }
65c97e0f
GS
87 }
88
e24bffee
MB
89 my $skip = 0;
90 if ($comment =~ s/\s+skip:\s*(.*)//) {
91 my $os = $1;
92 my $osv = exists $Config{osvers} ? $Config{osvers} : "0";
93 # >comment skip: all<
94 if ($os =~ /\ball\b/i) {
95 $skip = 1;
96 # >comment skip: VMS hpux:10.20<
97 } elsif ($os =~ /\b$^O(?::(\S+))?\b/i) {
98 my $vsn = defined $1 ? $1 : "0";
99 # Only compare on the the first pair of digits, as numeric
100 # compares don't like 2.6.10-3mdksmp or 2.6.8-24.10-default
101 s/^(\d+(\.\d+)?).*/$1/ for $osv, $vsn;
6f1f3b4a 102 $skip = $vsn ? ($osv <= $vsn ? 1 : 0) : 1;
e24bffee
MB
103 }
104 $skip and $comment =~ s/$/, failure expected on $^O $osv/;
105 }
106
be3174d2
GS
107 if ($x eq ">$result<") {
108 print "ok $i\n";
109 }
e24bffee
MB
110 elsif ($skip) {
111 print "ok $i # skip $comment\n";
112 }
48237dde 113 elsif ($y eq ">$result<") # Some C libraries always give
65c97e0f 114 { # three-digit exponent
00b6c67e 115 print("ok $i # >$result< $x three-digit exponent accepted\n");
65c97e0f 116 }
f7137e37
DD
117 elsif ($result =~ /[-+]\d{3}$/ &&
118 # Suppress tests with modulo of exponent >= 100 on platforms
119 # which can't handle such magnitudes (or where we can't tell).
120 ((!eval {require POSIX}) || # Costly: only do this if we must!
121 (length(&POSIX::DBL_MAX) - rindex(&POSIX::DBL_MAX, '+')) == 3))
122 {
00b6c67e 123 print("ok $i # >$template< >$data< >$result<",
e24bffee 124 " Suppressed: exponent out of range?\n");
f7137e37 125 }
be3174d2 126 else {
48237dde
GS
127 $y = ($x eq $y ? "" : " => $y");
128 print("not ok $i >$template< >$data< >$result< $x$y",
65c97e0f 129 $comment ? " # $comment\n" : "\n");
fb73857a
PP
130 }
131}
48237dde 132
a6d05634 133# In each of the following lines, there are three required fields:
be3174d2
GS
134# printf template, data to be formatted (as a Perl expression), and
135# expected result of formatting. An optional fourth field can contain
136# a comment. Each field is delimited by a starting '>' and a
137# finishing '<'; any whitespace outside these start and end marks is
138# not part of the field. If formatting requires more than one data
139# item (for example, if variable field widths are used), the Perl data
140# expression should return a reference to an array having the requisite
141# number of elements. Even so, subterfuge is sometimes required: see
142# tests for %n and %p.
143#
e24bffee
MB
144# Tests that are expected to fail on a certain OS can be marked as such
145# by trailing the comment with a skip: section. Skips are tags separated
146# bu space consisting of a $^O optionally trailed with :osvers. In the
147# latter case, all os-levels below that are expected to fail. A special
148# tag 'all' is allowed for todo tests that should fail on any system
149#
150# >%G< >1234567e96< >1.23457E+102< >exponent too big skip: os390<
6f1f3b4a 151# >%.0g< >-0.0< >-0< >No minus skip: MSWin32 VMS hpux:10.20<
e24bffee
MB
152# >%d< >4< >1< >4 != 1 skip: all<
153#
02a4ca6d
DD
154# The following tests are not currently run, for the reasons stated:
155
156=pod
157
158=begin problematic
159
02a4ca6d
DD
160>%.0f< >1.5< >2< >Standard vague: no rounding rules<
161>%.0f< >2.5< >2< >Standard vague: no rounding rules<
162
163=end problematic
164
165=cut
166
be3174d2
GS
167# template data result
168__END__
be3174d2 169>%6. 6s< >''< >%6. 6s INVALID< >(See use of $w in code above)<
c2e66d9e 170>%6 .6s< >''< >%6 .6s INVALID<
be3174d2 171>%6.6 s< >''< >%6.6 s INVALID<
c2e66d9e 172>%A< >''< >%A INVALID<
be3174d2
GS
173>%B< >''< >%B INVALID<
174>%C< >''< >%C INVALID<
175>%D< >0x7fffffff< >2147483647< >Synonym for %ld<
176>%E< >123456.789< >1.234568E+05< >Like %e, but using upper-case "E"<
177>%F< >123456.789< >123456.789000< >Synonym for %f<
178>%G< >1234567.89< >1.23457E+06< >Like %g, but using upper-case "E"<
c2e66d9e
GS
179>%G< >1234567e96< >1.23457E+102<
180>%G< >.1234567e-101< >1.23457E-102<
be3174d2 181>%G< >12345.6789< >12345.7<
e24bffee
MB
182>%G< >1234567e96< >1.23457E+102< >exponent too big skip: os390<
183>%G< >.1234567e-101< >1.23457E-102< >exponent too small skip: os390<
be3174d2
GS
184>%H< >''< >%H INVALID<
185>%I< >''< >%I INVALID<
186>%J< >''< >%J INVALID<
187>%K< >''< >%K INVALID<
188>%L< >''< >%L INVALID<
189>%M< >''< >%M INVALID<
190>%N< >''< >%N INVALID<
8234e14b 191>%O< >2**32-1< >37777777777< >Synonym for %lo<
be3174d2
GS
192>%P< >''< >%P INVALID<
193>%Q< >''< >%Q INVALID<
194>%R< >''< >%R INVALID<
195>%S< >''< >%S INVALID<
196>%T< >''< >%T INVALID<
8234e14b 197>%U< >2**32-1< >4294967295< >Synonym for %lu<
be3174d2
GS
198>%V< >''< >%V INVALID<
199>%W< >''< >%W INVALID<
200>%X< >2**32-1< >FFFFFFFF< >Like %x, but with u/c letters<
201>%#X< >2**32-1< >0XFFFFFFFF<
202>%Y< >''< >%Y INVALID<
203>%Z< >''< >%Z INVALID<
204>%a< >''< >%a INVALID<
205>%b< >2**32-1< >11111111111111111111111111111111<
206>%+b< >2**32-1< >11111111111111111111111111111111<
207>%#b< >2**32-1< >0b11111111111111111111111111111111<
208>%34b< >2**32-1< > 11111111111111111111111111111111<
209>%034b< >2**32-1< >0011111111111111111111111111111111<
210>%-34b< >2**32-1< >11111111111111111111111111111111 <
211>%-034b< >2**32-1< >11111111111111111111111111111111 <
212>%c< >ord('A')< >A<
213>%10c< >ord('A')< > A<
214>%#10c< >ord('A')< > A< ># modifier: no effect<
215>%010c< >ord('A')< >000000000A<
216>%10lc< >ord('A')< > A< >l modifier: no effect<
217>%10hc< >ord('A')< > A< >h modifier: no effect<
218>%10.5c< >ord('A')< > A< >precision: no effect<
219>%-10c< >ord('A')< >A <
220>%d< >123456.789< >123456<
221>%d< >-123456.789< >-123456<
222>%d< >0< >0<
223>%+d< >0< >+0<
224>%0d< >0< >0<
225>%.0d< >0< ><
226>%+.0d< >0< >+<
227>%.0d< >1< >1<
228>%d< >1< >1<
229>%+d< >1< >+1<
230>%#3.2d< >1< > 01< ># modifier: no effect<
231>%3.2d< >1< > 01<
232>%03.2d< >1< >001<
233>%-3.2d< >1< >01 <
234>%-03.2d< >1< >01 < >zero pad + left just.: no effect<
235>%d< >-1< >-1<
236>%+d< >-1< >-1<
237>%hd< >1< >1< >More extensive testing of<
238>%ld< >1< >1< >length modifiers would be<
239>%Vd< >1< >1< >platform-specific<
240>%vd< >chr(1)< >1<
241>%+vd< >chr(1)< >+1<
242>%#vd< >chr(1)< >1<
243>%vd< >"\01\02\03"< >1.2.3<
18eaf740
GA
244>%vd< >v1.2.3< >1.2.3<
245>%vd< >[version::qv("1.2.3")]< >1.2.3<
96b8f7ce
JP
246>%vd< >[version::qv("1.2")]< >1.2.0<
247>%vd< >[version::qv("1.02")]< >1.2.0<
248>%vd< >[version::qv("1.002")]< >1.2.0<
249>%vd< >[version::qv("1.02_03")]< >1.23<
250>%vd< >[version::qv("1048576.5")]< >1048576.5.0<
251>%vd< >[version::qv("50")]< >50.0.0<
252>%vd< >[version::qv("50_20")]< >50.200<
253>%vd< >[version::qv("5.005_03")]< >5.53<
be3174d2 254>%v.3d< >"\01\02\03"< >001.002.003<
211dfcf1 255>%0v3d< >"\01\02\03"< >001.002.003<
96b8f7ce 256>%v.3d< >[version::qv("1.2.3")]< >001.002.003<
211dfcf1
HS
257>%-v3d< >"\01\02\03"< >1 .2 .3 <
258>%+-v3d< >"\01\02\03"< >+1 .2 .3 <
96b8f7ce 259>%+-v3d< >[version::qv("1.2.3")]< >+1 .2 .3 <
be3174d2 260>%v4.3d< >"\01\02\03"< > 001. 002. 003<
211dfcf1
HS
261>%0v4.3d< >"\01\02\03"< >0001.0002.0003<
262>%0*v2d< >['-', "\0\7\14"]< >00-07-12<
263>%v.*d< >["\01\02\03", 3]< >001.002.003<
264>%0v*d< >["\01\02\03", 3]< >001.002.003<
265>%-v*d< >["\01\02\03", 3]< >1 .2 .3 <
266>%+-v*d< >["\01\02\03", 3]< >+1 .2 .3 <
267>%v*.*d< >["\01\02\03", 4, 3]< > 001. 002. 003<
268>%0v*.*d< >["\01\02\03", 4, 3]< >0001.0002.0003<
269>%0*v*d< >['-', "\0\7\13", 2]< >00-07-11<
96b8f7ce 270>%0*v*d< >['-', version::qv("0.7.11"), 2]< >00-07-11<
be3174d2 271>%e< >1234.875< >1.234875e+03<
c2e66d9e
GS
272>%e< >0.000012345< >1.234500e-05<
273>%e< >1234567E96< >1.234567e+102<
274>%e< >0< >0.000000e+00<
275>%e< >.1234567E-101< >1.234567e-102<
be3174d2
GS
276>%+e< >1234.875< >+1.234875e+03<
277>%#e< >1234.875< >1.234875e+03<
278>%e< >-1234.875< >-1.234875e+03<
279>%+e< >-1234.875< >-1.234875e+03<
280>%#e< >-1234.875< >-1.234875e+03<
281>%.0e< >1234.875< >1e+03<
02a4ca6d 282>%#.0e< >1234.875< >1.e+03<
20f6aaab
AS
283>%.0e< >1.875< >2e+00<
284>%.0e< >0.875< >9e-01<
be3174d2
GS
285>%.*e< >[0, 1234.875]< >1e+03<
286>%.1e< >1234.875< >1.2e+03<
287>%-12.4e< >1234.875< >1.2349e+03 <
288>%12.4e< >1234.875< > 1.2349e+03<
289>%+-12.4e< >1234.875< >+1.2349e+03 <
290>%+12.4e< >1234.875< > +1.2349e+03<
291>%+-12.4e< >-1234.875< >-1.2349e+03 <
292>%+12.4e< >-1234.875< > -1.2349e+03<
e24bffee
MB
293>%e< >1234567E96< >1.234567e+102< >exponent too big skip: os390<
294>%e< >.1234567E-101< >1.234567e-102< >exponent too small skip: os390<
be3174d2
GS
295>%f< >1234.875< >1234.875000<
296>%+f< >1234.875< >+1234.875000<
297>%#f< >1234.875< >1234.875000<
298>%f< >-1234.875< >-1234.875000<
299>%+f< >-1234.875< >-1234.875000<
300>%#f< >-1234.875< >-1234.875000<
301>%6f< >1234.875< >1234.875000<
302>%*f< >[6, 1234.875]< >1234.875000<
e24bffee 303>%.0f< >-0.1< >-0< >C library bug: no minus skip: VMS<
be3174d2
GS
304>%.0f< >1234.875< >1235<
305>%.1f< >1234.875< >1234.9<
306>%-8.1f< >1234.875< >1234.9 <
307>%8.1f< >1234.875< > 1234.9<
308>%+-8.1f< >1234.875< >+1234.9 <
309>%+8.1f< >1234.875< > +1234.9<
310>%+-8.1f< >-1234.875< >-1234.9 <
311>%+8.1f< >-1234.875< > -1234.9<
312>%*.*f< >[5, 2, 12.3456]< >12.35<
c2e66d9e
GS
313>%f< >0< >0.000000<
314>%.0f< >0< >0<
315>%.0f< >2**38< >274877906944< >Should have exact int'l rep'n<
d5365ef1 316>%.0f< >0.1< >0<
20f6aaab
AS
317>%.0f< >0.6< >1< >Known to fail with sfio, (irix|nonstop-ux|powerux); -DHAS_LDBL_SPRINTF_BUG may fix<
318>%.0f< >-0.6< >-1< >Known to fail with sfio, (irix|nonstop-ux|powerux); -DHAS_LDBL_SPRINTF_BUG may fix<
319>%.0f< >1.6< >2<
320>%.0f< >-1.6< >-2<
02a4ca6d
DD
321>%.0f< >1< >1<
322>%#.0f< >1< >1.<
00e17364
HS
323>%.0lf< >1< >1< >'l' should have no effect<
324>%.0hf< >1< >%.0hf INVALID< >'h' should be rejected<
be3174d2
GS
325>%g< >12345.6789< >12345.7<
326>%+g< >12345.6789< >+12345.7<
327>%#g< >12345.6789< >12345.7<
65ff66fc 328>%.0g< >-0.0< >-0< >C99 standard mandates minus sign but C89 does not skip: MSWin32 VMS hpux:10.20 openbsd netbsd:1.5 irix<
be3174d2 329>%.0g< >12345.6789< >1e+04<
02a4ca6d 330>%#.0g< >12345.6789< >1.e+04<
be3174d2
GS
331>%.2g< >12345.6789< >1.2e+04<
332>%.*g< >[2, 12345.6789]< >1.2e+04<
333>%.9g< >12345.6789< >12345.6789<
334>%12.9g< >12345.6789< > 12345.6789<
335>%012.9g< >12345.6789< >0012345.6789<
336>%-12.9g< >12345.6789< >12345.6789 <
337>%*.*g< >[-12, 9, 12345.6789]< >12345.6789 <
338>%-012.9g< >12345.6789< >12345.6789 <
339>%g< >-12345.6789< >-12345.7<
340>%+g< >-12345.6789< >-12345.7<
341>%g< >1234567.89< >1.23457e+06<
342>%+g< >1234567.89< >+1.23457e+06<
343>%#g< >1234567.89< >1.23457e+06<
344>%g< >-1234567.89< >-1.23457e+06<
345>%+g< >-1234567.89< >-1.23457e+06<
346>%#g< >-1234567.89< >-1.23457e+06<
c2e66d9e
GS
347>%g< >0.00012345< >0.00012345<
348>%g< >0.000012345< >1.2345e-05<
349>%g< >1234567E96< >1.23457e+102<
350>%g< >.1234567E-101< >1.23457e-102<
351>%g< >0< >0<
be3174d2
GS
352>%13g< >1234567.89< > 1.23457e+06<
353>%+13g< >1234567.89< > +1.23457e+06<
e24bffee
MB
354>%013g< >1234567.89< >001.23457e+06<
355>%-13g< >1234567.89< >1.23457e+06 <
356>%g< >.1234567E-101< >1.23457e-102< >exponent too small skip: os390<
357>%g< >1234567E96< >1.23457e+102< >exponent too big skip: os390<
be3174d2
GS
358>%h< >''< >%h INVALID<
359>%i< >123456.789< >123456< >Synonym for %d<
360>%j< >''< >%j INVALID<
361>%k< >''< >%k INVALID<
362>%l< >''< >%l INVALID<
363>%m< >''< >%m INVALID<
364>%s< >sprintf('%%n%n %d', $n, $n)< >%n 2< >Slight sneakiness to test %n<
365>%o< >2**32-1< >37777777777<
366>%+o< >2**32-1< >37777777777<
367>%#o< >2**32-1< >037777777777<
8234e14b
PP
368>%o< >642< >1202< >check smaller octals across platforms<
369>%+o< >642< >1202<
370>%#o< >642< >01202<
be3174d2 371>%d< >$p=sprintf('%p',$p);$p=~/^[0-9a-f]+$/< >1< >Coarse hack: hex from %p?<
0dbb1585 372>%d< >$p=sprintf('%-8p',$p);$p=~/^[0-9a-f]+\s*$/< >1< >Coarse hack: hex from %p?<
d5365ef1 373>%#p< >''< >%#p INVALID<
be3174d2
GS
374>%q< >''< >%q INVALID<
375>%r< >''< >%r INVALID<
376>%s< >'string'< >string<
377>%10s< >'string'< > string<
378>%+10s< >'string'< > string<
379>%#10s< >'string'< > string<
380>%010s< >'string'< >0000string<
381>%0*s< >[10, 'string']< >0000string<
382>%-10s< >'string'< >string <
383>%3s< >'string'< >string<
384>%.3s< >'string'< >str<
385>%.*s< >[3, 'string']< >str<
386>%t< >''< >%t INVALID<
387>%u< >2**32-1< >4294967295<
388>%+u< >2**32-1< >4294967295<
389>%#u< >2**32-1< >4294967295<
390>%12u< >2**32-1< > 4294967295<
391>%012u< >2**32-1< >004294967295<
392>%-12u< >2**32-1< >4294967295 <
393>%-012u< >2**32-1< >4294967295 <
394>%v< >''< >%v INVALID<
395>%w< >''< >%w INVALID<
396>%x< >2**32-1< >ffffffff<
397>%+x< >2**32-1< >ffffffff<
398>%#x< >2**32-1< >0xffffffff<
399>%10x< >2**32-1< > ffffffff<
400>%010x< >2**32-1< >00ffffffff<
401>%-10x< >2**32-1< >ffffffff <
402>%-010x< >2**32-1< >ffffffff <
403>%0-10x< >2**32-1< >ffffffff <
404>%0*x< >[-10, ,2**32-1]< >ffffffff <
96b8f7ce
JP
405>%vx< >[version::qv("1.2.3")]< >1.2.3<
406>%vx< >[version::qv("1.20.300")]< >1.14.12c<
be3174d2
GS
407>%y< >''< >%y INVALID<
408>%z< >''< >%z INVALID<
eb3fce90
JH
409>%2$d %1$d< >[12, 34]< >34 12<
410>%*2$d< >[12, 3]< > 12<
411>%2$d %d< >[12, 34]< >34 12<
412>%2$d %d %d< >[12, 34]< >34 12 34<
413>%3$d %d %d< >[12, 34, 56]< >56 12 34<
414>%2$*3$d %d< >[12, 34, 3]< > 34 12<
58e33a90 415>%*3$2$d %d< >[12, 34, 3]< >%*3$2$d 12 INVALID<
211dfcf1 416>%2$d< >12< >0 UNINIT<
eb3fce90
JH
417>%0$d< >12< >%0$d INVALID<
418>%1$$d< >12< >%1$$d INVALID<
419>%1$1$d< >12< >%1$1$d INVALID<
420>%*2$*2$d< >[12, 3]< >%*2$*2$d INVALID<
421>%*2*2$d< >[12, 3]< >%*2*2$d INVALID<
8896765a 422>%*2$1d< >[12, 3]< >%*2$1d INVALID<
211dfcf1 423>%0v2.2d< >''< ><
26372e71
GA
424>%vc,%d< >[63, 64, 65]< >%vc,63 INVALID<
425>%v%,%d< >[63, 64, 65]< >%v%,63 INVALID<
be75b157 426>%vd,%d< >[1, 2, 3]< >49,2<
26372e71
GA
427>%vf,%d< >[1, 2, 3]< >%vf,1 INVALID<
428>%vF,%d< >[1, 2, 3]< >%vF,1 INVALID<
429>%ve,%d< >[1, 2, 3]< >%ve,1 INVALID<
430>%vE,%d< >[1, 2, 3]< >%vE,1 INVALID<
431>%vg,%d< >[1, 2, 3]< >%vg,1 INVALID<
432>%vG,%d< >[1, 2, 3]< >%vG,1 INVALID<
be75b157 433>%vp< >''< >%vp INVALID<
26372e71
GA
434>%vn< >''< >%vn INVALID<
435>%vs,%d< >[1, 2, 3]< >%vs,1 INVALID<
be75b157 436>%v_< >''< >%v_ INVALID<
f3583277 437>%v#x< >''< >%v#x INVALID<
63c6dcc1 438>%v02x< >"foo\012"< >66.6f.6f.0a<
58e33a90
AE
439>%V-%s< >["Hello"]< >%V-Hello INVALID<
440>%K %d %d< >[13, 29]< >%K 13 29 INVALID<
441>%*.*K %d< >[13, 29, 76]< >%*.*K 13 INVALID<
442>%4$K %d< >[45, 67]< >%4$K 45 INVALID<
443>%d %K %d< >[23, 45]< >23 %K 45 INVALID<
3a7a539e 444>%*v*999\$d %d %d< >[11, 22, 33]< >%*v*999\$d 11 22 INVALID<
ed2b91d2
GA
445>%#b< >0< >0<
446>%#o< >0< >0<
447>%#x< >0< >0<
2fba7546
GA
448>%2147483647$v2d< >''< ><
449>%*2147483647$v2d< >''< > UNINIT<