From 80d01efafda1be0fd6a013eb590dde637f10616b Mon Sep 17 00:00:00 2001 From: Knagis Date: Mon, 8 Sep 2014 23:34:35 +0300 Subject: 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). --- runtests.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtests.pl') 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/\'/'/; + + # 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; -- cgit v1.2.3 From 45c1d9fadb3e8aab4a01bb27a4e2ece379902d1a Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Thu, 4 Sep 2014 17:26:11 +0200 Subject: 426/15 --- runtests.pl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtests.pl') diff --git a/runtests.pl b/runtests.pl index 2e2b795..e53938d 100644 --- a/runtests.pl +++ b/runtests.pl @@ -49,6 +49,7 @@ sub tidy s/ */ /; # collapse space before /> in tag s/ *\/>/\/>/; + s/>\n$/>/; # skip blank line if (/^$/) { next; @@ -89,8 +90,10 @@ sub dotest print $markdown; print "=== expected ===============\n"; print $html; + print "\n"; print "=== got ====================\n"; print $actual; + print "\n"; print color "black"; return 0; } -- cgit v1.2.3 From 3567b844ca1fd7bec62801f8758545f7bd5cbaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Ga=C5=86=C4=A3is?= Date: Wed, 10 Sep 2014 00:11:35 +0300 Subject: Moved removal of `\r` into `tidy()` --- runtests.pl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'runtests.pl') diff --git a/runtests.pl b/runtests.pl index d847140..f3e91ca 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 @@ -79,11 +81,7 @@ sub dotest $html = &tidy($html); $actual = &tidy($actual); $actual =~ s/\'/'/; - - # 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; -- cgit v1.2.3