#!/usr/bin/perl -w
-# $Id: basic.t,v 1.4 2002/01/28 02:56:19 eagle Exp $
+# $Id: basic.t,v 1.8 2004/12/31 21:27:58 eagle Exp $
#
# basic.t -- Basic tests for podlators.
#
-# Copyright 2001 by Russ Allbery <rra@stanford.edu>
+# Copyright 2001, 2002, 2004 by Russ Allbery <rra@stanford.edu>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
unshift (@INC, '../blib/lib');
}
unshift (@INC, '../blib/lib');
- require Config;
- if (($Config::Config{'extensions'} !~ /\bPOSIX\b/) ){
- print "1..0 # Skip -- Perl configured without POSIX module\n";
- exit 0;
- }
$| = 1;
print "1..11\n";
}
use Pod::Man;
use Pod::Text;
-use Pod::Text::Color;
use Pod::Text::Overstrike;
use Pod::Text::Termcap;
my $n = 2;
for (sort keys %translators) {
+ if ($_ eq 'Pod::Text::Color') {
+ eval { require Term::ANSIColor };
+ if ($@) {
+ print "ok $n # skip\n";
+ $n++;
+ print "ok $n # skip\n";
+ $n++;
+ next;
+ }
+ require Pod::Text::Color;
+ }
my $parser = $_->new (%options);
print (($parser && ref ($parser) eq $_) ? "ok $n\n" : "not ok $n\n");
$n++;
# For Pod::Man, strip out the autogenerated header up to the .TH title
# line. That means that we don't check those things; oh well. The header
# changes with each version change or touch of the input file.
+ $parser->parse_from_file (source_path ('basic.pod'), 'out.tmp');
+ undef $parser;
if ($_ eq 'Pod::Man') {
- $parser->parse_from_file (source_path ('basic.pod'), 'out.tmp');
open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
open (OUTPUT, "> out.$translators{$_}")
or die "Cannot create out.$translators{$_}: $!\n";
close TMP;
unlink 'out.tmp';
} else {
- my $basic = source_path ('basic.pod');
- $parser->parse_from_file ($basic, "out.$translators{$_}");
+ rename ('out.tmp', "out.$translators{$_}")
+ or die "Cannot rename out.tmp: $!\n";
}
{
local $/;