This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
diag.t: Fix FAIL and vFAIL support
authorFather Chrysostomos <sprout@cpan.org>
Sun, 17 Nov 2013 06:02:16 +0000 (22:02 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 17 Nov 2013 21:08:44 +0000 (13:08 -0800)
Until recently, it was treating them like Perl_croak et al., expecting
there to be an aTHX_.

Now that I fixed that, it turns out that FAIL and vFAIL (which were
being ignored, since all the calls lacked aTHX_) never worked anyway.

If they are matched by $source_msg_call_re, they end up in the wrong
if/else branch; namely, the one for handling packWARN, and they skip
over the one for tacking ‘in regex’ on to the end of the message.

t/porting/diag.t

index f0d5092..8c97688 100644 (file)
@@ -33,11 +33,12 @@ foreach (@{(setup_embed())[0]}) {
   push @functions, 'S_' . $_->[2] if $_->[0] =~ /s/;
 };
 
-my $regcomp_re = "(?<routine>(?:ckWARN(?:\\d+)?reg\\w*|vWARN\\d+))";
-my $function_re = join '|', @functions;
 my $regcomp_fail_re = '\b(?:(?:Simple_)?v)?FAIL[2-4]?(?:utf8f)?\b';
+my $regcomp_re =
+   "(?<routine>ckWARN(?:\\d+)?reg\\w*|vWARN\\d+|$regcomp_fail_re)";
+my $function_re = join '|', @functions;
 my $source_msg_re =
-   "(?<routine>\\bDIE\\b|$function_re|$regcomp_fail_re)";
+   "(?<routine>\\bDIE\\b|$function_re)";
 my $text_re = '"(?<text>(?:\\\\"|[^"]|"\s*[A-Z_]+\s*")*)"';
 my $source_msg_call_re = qr/$source_msg_re(?:_nocontext)? \s*
     \((?:aTHX_)? \s*