From: Marcus Holland-Moritz Date: Sun, 9 Nov 2008 09:52:31 +0000 (+0000) Subject: Update format warning tests to expect "%lld" instead of "%d" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ff953de4413c0a2ba18ee101fe681711dfa55e3;p=p5sagit%2Fp5-mst-13.2.git Update format warning tests to expect "%lld" instead of "%d" when "%lld" was in the format string. Mark these warnings as TODO until this is fixed. p4raw-id: //depot/perl@34781 --- diff --git a/t/op/sprintf2.t b/t/op/sprintf2.t index 3e608d8..c27df06 100644 --- a/t/op/sprintf2.t +++ b/t/op/sprintf2.t @@ -148,20 +148,23 @@ eval { my $q = pack "q", 0 }; my $Q = $@ eq ''; my @tests = ( - [ '%lld' => '%d', [qw( 4294967296 -100000000000000 )] ], - [ '%lli' => '%i', [qw( 4294967296 -100000000000000 )] ], - [ '%llu' => '%u', [qw( 4294967296 100000000000000 )] ], - [ '%Ld' => '%d', [qw( 4294967296 -100000000000000 )] ], - [ '%Li' => '%i', [qw( 4294967296 -100000000000000 )] ], - [ '%Lu' => '%u', [qw( 4294967296 100000000000000 )] ], + [ '%lld' => [qw( 4294967296 -100000000000000 )] ], + [ '%lli' => [qw( 4294967296 -100000000000000 )] ], + [ '%llu' => [qw( 4294967296 100000000000000 )] ], + [ '%Ld' => [qw( 4294967296 -100000000000000 )] ], + [ '%Li' => [qw( 4294967296 -100000000000000 )] ], + [ '%Lu' => [qw( 4294967296 100000000000000 )] ], ); for my $t (@tests) { - my($fmt, $conv) = @$t; - for my $num (@{$t->[2]}) { + my($fmt, $nums) = @$t; + for my $num (@$nums) { my $w; local $SIG{__WARN__} = sub { $w = shift }; is(sprintf($fmt, $num), $Q ? $num : $fmt, "quad: $fmt -> $num"); - like($w, $Q ? '' : qr/Invalid conversion in sprintf: "$conv"/, "warning: $fmt"); + { + local our $TODO = $Q ? "" : "warning doesn't contain length modifiers"; + like($w, $Q ? '' : qr/Invalid conversion in sprintf: "$fmt"/, "warning: $fmt"); + } } }