Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* diag diff if it failed

  • Loading branch information...
commit 0e43c3138f837e0d7eaf507504f54704ec6a92b7 1 parent 74b0a51
Masayoshi Sekimura authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 xt/MarkdownTest_1.0.3.t
View
13 xt/MarkdownTest_1.0.3.t
@@ -13,21 +13,26 @@ BEGIN { use_ok('Text::Markdown::Discount') };
#########################
use FindBin qw($Bin);
+use Text::Diff;
opendir(DIR, "$Bin/../xt/MarkdownTest_1.0.3/Tests");
foreach my $testfile (grep { /\.text$/ } readdir(DIR)) {
my $testname = $testfile;
$testname =~ s{(.+)\.text$}{$1}i;
- ok $testfile, $testname;
- open (EXPECTED, "$Bin/../xt/MarkdownTest_1.0.3/Tests/$testname" . '.html');
+ open (EXPECTED, "$Bin/../xt/MarkdownTest_1.0.3/Tests/$testname" . '.html') or die "NO html file for $testname";
my $expected = do {undef $/; <EXPECTED>};
- my $actual = `$Bin/../xt/MarkdownXS.pl '$Bin/../xt/MarkdownTest_1.0.3/Tests/$testfile'`;
+ my $actual = `$Bin/../xt/MarkdownXS.pl '$Bin/../xt/MarkdownTest_1.0.3/Tests/$testfile'` or die "failed run MarkdownXS.pl $testfile";
$expected =~ s{'}{'\\''}g; # escape ' chars for shell
$actual =~ s{'}{'\\''}g;
$expected = `echo '$expected' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`;
$actual = `echo '$actual' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`;
- is ($actual, $expected, $testname);
+ if ($actual eq $expected) {
+ pass($testname);
+ } else {
+ fail($testname);
+ diag diff \$expected, \$actual;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.