This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/re/reg_mesg.t: Add diagnostic output on some failures
authorKarl Williamson <public@khwilliamson.com>
Wed, 26 Jun 2013 23:51:36 +0000 (17:51 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 27 Jun 2013 04:39:16 +0000 (22:39 -0600)
t/re/reg_mesg.t

index 56c7b55..a7da15a 100644 (file)
@@ -308,7 +308,12 @@ foreach my $ref (\@warning, \@experimental_regex_sets, \@deprecated) {
                 }
             }
             foreach my $i (0 .. $count - 1) {
-                if (like($got[$i], qr/\Q$expect[$i]/, "... and gave expected warning[$i]")) {
+                if (! like($got[$i], qr/\Q$expect[$i]/, "... and gave expected warning")) {
+                    chomp($got[$i]);
+                    chomp($expect[$i]);
+                    diag("GOT\n'$got[$i]'\nEXPECT\n'$expect[$i]'");
+                }
+                else {
                     ok (0 == capture_warnings(sub {
                                     $_ = "x";
                                     eval "no warnings '$warning_type'; $regex;" }