diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-12-11 20:34:33 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-12-11 20:34:33 +0000 |
commit | 57c348a981665d6305f7f38920ab85e57a77ae65 (patch) | |
tree | 33edc1bdd224553e2fcf70ecf1b4f1da8bd05d87 /t | |
parent | 0a52d15ba5fbf8c2d2178fca6186b8b527a2e596 (diff) | |
download | perl-57c348a981665d6305f7f38920ab85e57a77ae65.tar.gz |
Move the rest of the data munging into the test preparation loop.
p4raw-id: //depot/perl@26324
Diffstat (limited to 't')
-rwxr-xr-x | t/op/sprintf.t | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 8f2ee05636..7d35cb2e85 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -46,6 +46,9 @@ while (<DATA>) { $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; |