diff --git a/t/sanity.t b/t/sanity.t index 003c069..d92a9b3 100644 --- a/t/sanity.t +++ b/t/sanity.t @@ -2,7 +2,7 @@ use strict; use warnings; use Test::More tests => 1; -use Test::Differences; +use Text::Diff; sub shell (@); sub cd ($); @@ -25,7 +25,7 @@ open $in, "../t/help.txt" or my $expected = do { local $/; <$in> }; close $in; -eq_or_diff $got, $expected, "--help ok"; +is_diff($got, $expected, "--help ok"); sub shell (@) { print "@_\n"; @@ -38,3 +38,14 @@ sub cd ($) { chdir $dir or die "failed to cd $dir: $!\n"; } +sub is_diff { + my ($actual, $expected, $name) = @_; + + if (!defined $name) { + $name = ''; + } + + ok $actual eq $expected, + $name . "\n" . Text::Diff::diff(\$expected, \$actual); +} +