From: Nicholas Clark Date: Sun, 11 Dec 2005 20:34:33 +0000 (+0000) Subject: Move the rest of the data munging into the test preparation loop. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57c348a981665d6305f7f38920ab85e57a77ae65;p=p5sagit%2Fp5-mst-13.2.git Move the rest of the data munging into the test preparation loop. p4raw-id: //depot/perl@26324 --- diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 8f2ee05..7d35cb2 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -46,6 +46,9 @@ while () { $data =~ s/([eE])\-101$/${1}-24/; # larger exponents $result =~ s/([eE])\-102$/${1}-25/; # " " } + + $evalData = eval $data; + $data = ref $evalData ? $evalData : [$evalData]; push @tests, [$template, $data, $result, $comment]; } @@ -63,10 +66,8 @@ $SIG{__WARN__} = sub { for ($i = 1; @tests; $i++) { ($template, $data, $result, $comment) = @{shift @tests}; - $evalData = eval $data; $w = undef; - $x = sprintf(">$template<", - defined @$evalData ? @$evalData : $evalData); + $x = sprintf(">$template<", @$data); substr($x, -1, 0) = $w if $w; # $x may have 3 exponent digits, not 2 my $y = $x;