summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-09-17 15:56:30 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-09-17 15:56:30 -0700
commit41435824d9ff0212465d25f2e417c98e56a9e2c3 (patch)
tree90c03e4b954344beadd1c011dd7a5fea91b8a9a1
parentf22e1f2536cc70e1f989e457079f1bad252c887a (diff)
parent3567b844ca1fd7bec62801f8758545f7bd5cbaae (diff)
Merge pull request #97 from Knagis/master
Updated runtests.pl to support Windows
-rw-r--r--runtests.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtests.pl b/runtests.pl
index e53938d..0bff360 100644
--- a/runtests.pl
+++ b/runtests.pl
@@ -38,7 +38,9 @@ sub tidy
} elsif (/<\/pre/) {
$inpre = 0;
}
- if ($inpre) {
+ # remove \r to allow mixing linux/windows newlines
+ s/\r//;
+ if ($inpre) {
print $outfh $_;
} else {
# remove leading spaces
@@ -70,15 +72,17 @@ sub dotest
# We use → to indicate tab and ␣ space in the spec
$markdown =~ s/→/\t/g;s/␣/ /g;
$html =~ s/→/\t/g;s/␣/ /g;
- open2(my $out, my $in, @PROG);
+ my $pid = open2(my $out, my $in, @PROG);
print $in $markdown;
close $in;
flush $out;
$actual = do { local $/; <$out>; };
close $out;
+ waitpid($pid, 0);
$html = &tidy($html);
$actual = &tidy($actual);
$actual =~ s/\&#39;/'/;
+
if ($actual eq $html) {
print colored("✓", "green");
return 1;