In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/cf549b97af10073cdfe2efa120d97a5b53ecd85c?hp=59a08c763def19a317f229e4a95b1cdf6db8e12d>
- Log ----------------------------------------------------------------- commit cf549b97af10073cdfe2efa120d97a5b53ecd85c Author: Dan Collins <[email protected]> Date: Sat Jun 18 17:24:22 2016 -0400 t/re/regexp.t: Remove extra semicolons from output. The $code segment in t/re/regexp.t contains an extra ';' for the first iteration of each test, due to how 'study' and 'utf8::upgrade' testing is implemented. Since this is the only test likely to fail (what with study being a no-op), this is almost always line noise. This patch removes that ';'. It would be nice to remove the back to back newlines as well. M t/re/regexp.t commit 6ea2424c9bce5f5733208cdb4ff57aef6c63fbc7 Author: Dan Collins <[email protected]> Date: Sat Jun 18 16:52:26 2016 -0400 t/re/regexp.t: Better formatting for test failures On test failure, most of our tests output a description of the test, followed by the actual result ("got") and the desired result ("expected"). This brings the tests in t/re/re_tests in line by adding "expected" to the output, and changing the order slightly, to more naturally describe the test, the output, and the expectation. M t/re/regexp.t ----------------------------------------------------------------------- Summary of changes: t/re/regexp.t | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/t/re/regexp.t b/t/re/regexp.t index 8e98e55..5ec6e5c 100644 --- a/t/re/regexp.t +++ b/t/re/regexp.t @@ -358,8 +358,8 @@ foreach (@tests) { } } - for my $study ('', 'study $subject', 'utf8::upgrade($subject)', - 'utf8::upgrade($subject); study $subject') { + for my $study ('', 'study $subject;', 'utf8::upgrade($subject);', + 'utf8::upgrade($subject); study $subject;') { # Need to make a copy, else the utf8::upgrade of an already studied # scalar confuses things. my $subject = $subject; @@ -367,7 +367,7 @@ foreach (@tests) { my ($code, $match, $got); if ($repl eq 'pos') { $code= <<EOFCODE; - $study; + $study pos(\$subject)=0; \$match = ( \$subject =~ m${pat}g ); \$got = pos(\$subject); @@ -376,7 +376,7 @@ EOFCODE elsif ($qr_embed) { $code= <<EOFCODE; my \$RE = qr$pat; - $study; + $study \$match = (\$subject =~ /(?:)\$RE(?:)/) while \$c--; \$got = "$repl"; EOFCODE @@ -386,14 +386,14 @@ EOFCODE # Can't run the match in a subthread, but can do this and # clone the pattern the other way. my \$RE = threads->new(sub {qr$pat})->join(); - $study; + $study \$match = (\$subject =~ /(?:)\$RE(?:)/) while \$c--; \$got = "$repl"; EOFCODE } else { $code= <<EOFCODE; - $study; + $study \$match = (\$subject =~ $OP$pat) while \$c--; \$got = "$repl"; EOFCODE @@ -442,7 +442,8 @@ EOFCODE else { # better diagnostics my $s = Data::Dumper->new([$subject],['subject'])->Useqq(1)->Dump; my $g = Data::Dumper->new([$got],['got'])->Useqq(1)->Dump; - print "not ok $testname$todo ($study) $input => '$got', match=$match\n", _comment("$s\n$g\n$code\n"); + my $e = Data::Dumper->new([$expect],['expected'])->Useqq(1)->Dump; + print "not ok $testname$todo ($study) $input => '$got', match=$match\n", _comment("$s\n$code\n$g\n$e\n"); } next TEST; } -- Perl5 Master Repository
