1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
use 5.006;
use strict;
use warnings;
use Config;
use Test::More;
my @Files = qw(cut for link list paragraph sequence);
my $NFiles = @Files;
plan tests => 3 * $NFiles;
my $Dir = "t/pod2html.d";
for my $file (@Files) {
my $pod = "$Dir/$file.pod";
my $html = "$Dir/$file.html";
my $exp = "$Dir/$file.exp";
unlink $html;
system "$Config{perlpath} blib/script/podtree2html --notoc $pod $html";
ok !FileCmp( $html, $exp );
}
for my $file (@Files) {
my $pod = "$Dir/$file.pod";
my $html = "$Dir/$file.html_t";
my $exp = "$Dir/$file.exp_t";
my $template = "$Dir/template.txt";
my $values = "$Dir/values.pl";
unlink $html;
system "$Config{perlpath} blib/script/podtree2html --notoc -variables $values $pod $html $template";
ok !FileCmp( $html, $exp );
}
for my $file (@Files) {
my $pod = "$Dir/$file.pod";
my $html = "$Dir/$file.html_tv";
my $exp = "$Dir/$file.exp_tv";
my $template = "$Dir/template.txt";
my $values = "$Dir/values.pl";
unlink $html;
system "$Config{perlpath} blib/script/podtree2html --notoc -variables $values $pod $html $template color=red";
ok !FileCmp( $html, $exp );
}
sub FileCmp {
my ( $x, $y ) = @_;
local $/ = undef;
open my $fx, '<', $x or die "Can't open $x: $!\n";
open my $fy, '<', $y or die "Can't open $y: $!\n";
return <$fx> ne <$fy>;
}
|