From: Rafael Garcia-Suarez Date: Fri, 26 Dec 2008 14:09:49 +0000 (+0100) Subject: Upgrade to podlators 2.2.1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eccdc4d715215b93b6b598d8cf3ac12e323f67e0;p=p5sagit%2Fp5-mst-13.2.git Upgrade to podlators 2.2.1 --- diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm index fa1fd57..23c8ae9 100644 --- a/lib/Pod/Text.pm +++ b/lib/Pod/Text.pm @@ -37,7 +37,7 @@ use Pod::Simple (); # We have to export pod2text for backward compatibility. @EXPORT = qw(pod2text); -$VERSION = '3.12_01'; +$VERSION = '3.13'; ############################################################################## # Initialization @@ -609,6 +609,7 @@ sub pod2text { close $fh; return $retval; } else { + $parser->output_fh (\*STDOUT); return $parser->parse_file (@_); } } diff --git a/lib/Pod/t/man.t b/lib/Pod/t/man.t index 7071ba8..419cce3 100644 --- a/lib/Pod/t/man.t +++ b/lib/Pod/t/man.t @@ -17,7 +17,7 @@ BEGIN { } unshift (@INC, '../blib/lib'); $| = 1; - print "1..24\n"; + print "1..25\n"; } END { @@ -451,3 +451,34 @@ E .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. +### diff --git a/lib/Pod/t/pod-parser.t b/lib/Pod/t/pod-parser.t index 21817fe..318a76b 100644 --- a/lib/Pod/t/pod-parser.t +++ b/lib/Pod/t/pod-parser.t @@ -2,7 +2,7 @@ # # pod-parser.t -- Tests for backward compatibility with Pod::Parser. # -# Copyright 2006 by Russ Allbery +# Copyright 2006, 2008 by Russ Allbery # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. @@ -16,15 +16,18 @@ BEGIN { } 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"; @@ -70,5 +73,30 @@ if ($output eq " Some random text.\n\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.\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 = ; +} +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; diff --git a/lib/Pod/t/text.t b/lib/Pod/t/text.t index b4c7727..2ef9aab 100644 --- a/lib/Pod/t/text.t +++ b/lib/Pod/t/text.t @@ -2,7 +2,7 @@ # # text.t -- Additional specialized tests for Pod::Text. # -# Copyright 2002, 2004, 2006, 2007 by Russ Allbery +# Copyright 2002, 2004, 2006, 2007, 2008 by Russ Allbery # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. @@ -16,7 +16,7 @@ BEGIN { } unshift (@INC, '../blib/lib'); $| = 1; - print "1..4\n"; + print "1..5\n"; } END { @@ -101,3 +101,30 @@ Test of S<> 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. + +###