Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More cleanups to Helper.pm.

  • Loading branch information...
commit fdcff91fe1588ca64733f91ca319216f1c5ecc1a 1 parent 3dc282c
@shlomif authored
Showing with 12 additions and 8 deletions.
  1. +12 −8 t/Helper.pm
View
20 t/Helper.pm
@@ -74,15 +74,19 @@ sub run_debugger($$;$$)
my $gotfile = $ext_file->('got');
- if ($right_string eq $output) {
- Test::More::ok(1);
- unlink $gotfile;
+ # TODO : Perhaps make sure we optionally use eq_or_diff from
+ # Test::Differences here.
+ if (Test::More::is($right_string, $output, 'Output comparison')) {
+ unlink $gotfile;
} else {
- my $diff = String::Diff::diff_merge($output, $right_string);
- open(GOT_FH, ">$gotfile");
- print GOT_FH $output;
- print $diff;
- Test::More::ok(0, "Output comparison fails");
+ my $diff = String::Diff::diff_merge($output, $right_string);
+
+ open (my $got_fh, '>', $gotfile)
+ or die "Cannot open '$gotfile' for writing - $!";
+ print {$got_fh} $output;
+ close($got_fh);
+
+ Test::More::diag($diff);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.