Skip to content

Commit

Permalink
Item9001: Remove some checks like trimming empty which are interestin…
Browse files Browse the repository at this point in the history
…g, but in a second phase

git-svn-id: http://svn.foswiki.org/trunk@7472 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed May 19, 2010
1 parent e0be776 commit aeab75c
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions UnitTestContrib/test/unit/HTMLValidationTests.pm
Expand Up @@ -35,7 +35,7 @@ sub set_up {
#'accessibility-check' => 3,
'drop-empty-paras' => 0
});
print STDERR "HTML::Tidy Version: ".$HTML::Tidy::VERSION."\n";
#print STDERR "HTML::Tidy Version: ".$HTML::Tidy::VERSION."\n";
#print STDERR "libtidy Version: ".HTML::Tidy::libtidy_version()."\n";

$this->SUPER::set_up();
Expand Down Expand Up @@ -165,13 +165,22 @@ sub verify_switchboard_function {
#$this->expect_failure();
$this->annotate("MISSING DOCTYPE - we're returning a messy text error\n$output\n");
} else {
unless ($output eq '') {
#save the output html..
open( F, ">${testcase}_run.html" );
print F $text;
close F;
for( $output ) { # Remove OK warnings
# Empty title, no easy fix and harmless
s/^$testcase \(\d+:\d+\) Warning: trimming empty <(?:h1|span)>\n?$//gm;
s/^\s*$//;
}
my $outfile = "${testcase}_run.html";
if ($output eq '') {
unlink $outfile; # Remove stale output file
}
else { # save the output html..
open( my $fh, '>', $outfile ) or die "Can't open $outfile: $!";
print $fh $text;
close $fh;
}
$this->assert_equals('', $output);
$this->assert_equals('', $output,
"Script $SCRIPT_NAME, skin $SKIN_NAME gave errors, output in $outfile:\n$output");
}
#clean up messages for next run..
$this->{tidy}->clear_messages();
Expand Down

0 comments on commit aeab75c

Please sign in to comment.