# We have to export pod2text for backward compatibility.
@EXPORT = qw(pod2text);
-$VERSION = '3.12_01';
+$VERSION = '3.13';
##############################################################################
# Initialization
close $fh;
return $retval;
} else {
+ $parser->output_fh (\*STDOUT);
return $parser->parse_file (@_);
}
}
}
unshift (@INC, '../blib/lib');
$| = 1;
- print "1..24\n";
+ print "1..25\n";
}
END {
.el .SH "\f(CWone\fP and \f(CWtwo\fP"
.IX Header "one and two"
###
+
+###
+=pod
+
+Some text.
+
+=for man
+Some raw nroff.
+
+=for roff \fBBold text.\fP
+
+=for html
+Stuff that's hidden.
+
+=for MAN \fIItalic text.\fP
+
+=for ROFF
+.PP
+\&A paragraph.
+
+More text.
+###
+Some text.
+Some raw nroff.
+\fBBold text.\fP
+\fIItalic text.\fP
+.PP
+\&A paragraph.
+.PP
+More text.
+###
#
# pod-parser.t -- Tests for backward compatibility with Pod::Parser.
#
-# Copyright 2006 by Russ Allbery <rra@stanford.edu>
+# Copyright 2006, 2008 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');
$| = 1;
- print "1..3\n";
+ print "1..4\n";
}
+my $loaded;
+
END {
print "not ok 1\n" unless $loaded;
}
use Pod::Man;
use Pod::Text;
+use strict;
$loaded = 1;
print "ok 1\n";
print "Output\n======\n$output\n";
}
+# Test the pod2text function, particularly with only one argument.
+open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
+print TMP "=pod\n\nSome random B<text>.\n";
+close TMP;
+open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
+open (SAVE, '>&STDOUT') or die "Cannot dup stdout: $!\n";
+open (STDOUT, '>&OUT') or die "Cannot replace stdout: $!\n";
+pod2text ('tmp.pod');
+close OUT;
+open (STDOUT, '>&SAVE') or die "Cannot fix stdout: $!\n";
+close SAVE;
+open (OUT, 'out.tmp') or die "Cannot open out.tmp: $!\n";
+{
+ local $/;
+ $output = <OUT>;
+}
+close OUT;
+if ($output eq " Some random text.\n\n") {
+ print "ok 4\n";
+} else {
+ print "not ok 4\n";
+ print "Expected\n========\n Some random text.\n\n\n";
+ print "Output\n======\n$output\n";
+}
+
unlink ('tmp.pod', 'out.tmp');
exit 0;
#
# text.t -- Additional specialized tests for Pod::Text.
#
-# Copyright 2002, 2004, 2006, 2007 by Russ Allbery <rra@stanford.edu>
+# Copyright 2002, 2004, 2006, 2007, 2008 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');
$| = 1;
- print "1..4\n";
+ print "1..5\n";
}
END {
This is some whitespace.
###
+
+###
+=head1 Test of =for
+
+=for comment
+This won't be seen.
+
+Yes.
+
+=for text
+This should be seen.
+
+=for TEXT As should this.
+
+=for man
+But this shouldn't.
+
+Some more text.
+###
+Test of =for
+ Yes.
+
+This should be seen.
+As should this.
+ Some more text.
+
+###