summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKnagis <Knagis@users.noreply.github.com>2014-09-08 23:34:35 +0300
committerKnagis <Knagis@users.noreply.github.com>2014-09-08 23:34:35 +0300
commit80d01efafda1be0fd6a013eb590dde637f10616b (patch)
treedfce715c67258f823c03fd0736c7687eec74cd13
parent2cf0750a7a507eded4cf3c9a48fd1f924d0ce538 (diff)
Updated to support Perl on Windows
waitpid() is required because otherwise Perl on Windows might fail after 64 or 128 tests. removing '\r' from both test output and generated output enables both spec.txt and the generated results to contain Windows newlines (\r\n).
-rw-r--r--runtests.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtests.pl b/runtests.pl
index 2e2b795..d847140 100644
--- a/runtests.pl
+++ b/runtests.pl
@@ -69,15 +69,21 @@ 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;/'/;
+
+ # remove \r to allow mixing of linux/windows newlines
+ $actual =~ s/\r//g;
+ $html =~ s/\r//g;
+
if ($actual eq $html) {
print colored("✓", "green");
return 1;