Front page | perl.perl5.porters |
Postings from January 2013
[perl #116513] [PATCH] converted t/op/sprintf.t to use test.pl
Thread Next
From:
James E Keenan via RT
Date:
January 26, 2013 04:25
Subject:
[perl #116513] [PATCH] converted t/op/sprintf.t to use test.pl
Message ID:
rt-3.6.HEAD-27190-1359174350-320.116513-15-0@perl.org
On Tue Jan 22 12:02:43 2013, hanekomu wrote:
> This is a bug report for perl from hanekomu@gmail.com,
> generated with the help of perlbug 1.39 running under perl 5.16.0.
>
> From 9b8eed89c7b18f2ea8767152c0bfced1e30b6379 Mon Sep 17 00:00:00 2001
> From: Marcel Gruenauer <hanekomu@gmail.com>
> Date: Tue, 22 Jan 2013 18:38:39 +0100
> Subject: [PATCH 3/6] converted t/op/sprintf.t to use test.pl
>
> ---
> t/op/sprintf.t | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/t/op/sprintf.t b/t/op/sprintf.t
> index ca07032..372ca90 100644
> --- a/t/op/sprintf.t
> +++ b/t/op/sprintf.t
> @@ -16,9 +16,10 @@ use warnings;
> use version;
> use Config;
> use strict;
> +require './test.pl';
>
> my @tests = ();
> -my ($i, $template, $data, $result, $comment, $w, $x, $evalData, $n,
> $p);
> +my ($template, $data, $result, $comment, $w, $x, $evalData, $n, $p);
>
> my $Is_VMS_VAX = 0;
> # We use HW_MODEL since ARCH_NAME was not in VMS V5.*
> @@ -55,7 +56,7 @@ while (<DATA>) {
> push @tests, [$template, $evalData, $result, $comment, $data];
> }
>
> -print '1..', scalar @tests, "\n";
> +plan(scalar @tests);
>
> $SIG{__WARN__} = sub {
> if ($_[0] =~ /^Invalid conversion/) {
> @@ -71,8 +72,8 @@ $SIG{__WARN__} = sub {
> }
> };
>
> -for ($i = 1; @tests; $i++) {
> - ($template, $evalData, $result, $comment, $data) = @{shift
> @tests};
> +for (@tests) {
> + ($template, $evalData, $result, $comment, $data) = @$_;
> $w = undef;
> $x = sprintf($template, @$evalData);
> $x = ">$x<" if defined $x;
> @@ -113,14 +114,14 @@ for ($i = 1; @tests; $i++) {
> }
>
> if ($x eq ">$result<") {
> - print "ok $i - >$result<\n";
> + ok(1, ">$result<");
> }
> elsif ($skip) {
> - print "ok $i - # skip $comment\n";
> + ok(1, "skip $comment");
> }
> elsif ($y eq ">$result<") # Some C libraries always give
> { # three-digit exponent
> - print("ok $i - # >$result< $x three-digit exponent accepted\n");
> + ok(1, ">$result< $x three-digit exponent accepted");
> }
> elsif ($result =~ /[-+]\d{3}$/ &&
> # Suppress tests with modulo of exponent >= 100 on platforms
> @@ -128,13 +129,12 @@ for ($i = 1; @tests; $i++) {
> ((!eval {require POSIX}) || # Costly: only do this if we must!
> (length(&POSIX::DBL_MAX) - rindex(&POSIX::DBL_MAX, '+')) == 3))
> {
> - print("ok $i - # >$template< >$data< >$result<",
> - " Suppressed: exponent out of range?\n");
> + ok(1,
> + ">$template< >$data< >$result< Suppressed: exponent out of
> range?\n");
> }
> else {
> - $y = ($x eq $y ? "" : " => $y");
> - print("not ok $i - >$template< >$data< >$result< $x$y",
> - $comment ? " # $comment\n" : "\n");
> + $y = ($x eq $y ? "" : " => $y");
> + ok(0, ">$template< >$data< >$result< $x$y $comment");
> }
> }
>
Marcel:
Could you please re-send this patch as an attachment (either to an email
or in the rt.perl.org GUI)?
Same request for RT #116509 and #116515.
I have tried twice to copy this patch from either the GUI or p5p
newsgroup, and the patch has failed to apply both times.
P5P readers: Assuming your patches are logically correct, they will
actually get applied much more quickly if you send or post them *as
attachments* rather than inline in the body of an email or RT post.
Thank you very much.
Jim Keenan
---
via perlbug: queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116513
Thread Next
-
[perl #116513] [PATCH] converted t/op/sprintf.t to use test.pl
by James E Keenan via RT