4 use File::Spec::Functions;
7 my($podfile, $testname) = @_;
10 my $base_dir = catdir $cwd, updir(), "lib", "Pod";
11 my $new_dir = catdir $base_dir, "t";
12 my $infile = catfile $new_dir, "$podfile.pod";
13 my $outfile = catfile $new_dir, "$podfile.html";
17 "--podroot=$base_dir",
24 my ($expect, $result);
29 $expect =~ s/\[PERLADMIN\]/$Config::Config{perladmin}/;
30 if (ord("A") == 193) { # EBCDIC.
31 $expect =~ s/item_mat%3c%21%3e/item_mat%4c%5a%6e/;
35 open my $in, $outfile or die "cannot open $outfile: $!";
40 ok($expect eq $result, $testname) or do {
41 my $diff = '/bin/diff';
42 -x $diff or $diff = '/usr/bin/diff';
44 my $expectfile = "pod2html-lib.tmp";
45 open my $tmpfile, ">", $expectfile or die $!;
46 print $tmpfile $expect;
48 my $diffopt = $^O eq 'linux' ? 'u' : 'c';
49 open my $diff, "diff -$diffopt $expectfile $outfile |" or die $!;
50 print "# $_" while <$diff>;
56 # pod2html creates these
57 1 while unlink $outfile;
58 1 while unlink "pod2htmd.tmp";
59 1 while unlink "pod2htmi.tmp";