FAQ
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/bdc905d035d4f835a808f1825dad9a8cd726d1ec?hp=4911bc40d408c8c5acf325e388b3e0513ef90571>

- Log -----------------------------------------------------------------
commit bdc905d035d4f835a808f1825dad9a8cd726d1ec
Author: Karl Williamson <khw@cpan.org>
Date: Mon May 30 10:39:05 2016 -0600

     Unicode/UCD.t: better handling of errors

     This now looks for the PERL_DIFF_TOOL environment variable, and if found
     uses that to display some problems. If not found, it uses is(), with a
     message that better output is available through setting this variable.

     PERL_DIFF_TOOL is a convention I wasn't familiar with.
-----------------------------------------------------------------------

Summary of changes:
  lib/Unicode/UCD.t | 13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t
index 83320d3..8f8e551 100644
--- a/lib/Unicode/UCD.t
+++ b/lib/Unicode/UCD.t
@@ -1415,9 +1415,14 @@ sub fail_with_diff ($$$$) {
      # For use below to output better messages
      my ($prop, $official, $constructed, $tested_function_name) = @_;

- is($constructed, $official, "$tested_function_name('$prop')");
- diag("Comment out lines " . (__LINE__ - 1) . " through " . (__LINE__ + 1) . " in '$0' on Un*x-like systems to see just the differences. Uses the 'diff' first in your \$PATH");
- return;
+ if (! $ENV{PERL_DIFF_TOOL}) {
+
+ is($constructed, $official, "$tested_function_name('$prop')");
+
+ diag("Set environment variable PERL_DIFF_TOOL=diff_tool to see just "
+ . "the differences.");
+ return;
+ }

      fail("$tested_function_name('$prop')");

@@ -1434,7 +1439,7 @@ sub fail_with_diff ($$$$) {
      close $gend || die "Can't close gend";

      my $diff = File::Temp->new();
- system("diff $off $gend > $diff");
+ system("$ENV{PERL_DIFF_TOOL} $off $gend > $diff");

      open my $fh, "<", $diff || die "Can't open $diff";
      my @diffs = <$fh>;

--
Perl5 Master Repository

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-changes @
categoriesperl
postedMay 30, '16 at 4:45p
activeMay 30, '16 at 4:45p
posts1
users1
websiteperl.org

1 user in discussion

Karl Williamson: 1 post

People

Translate

site design / logo © 2018 Grokbase