summaryrefslogtreecommitdiff
path: root/lib/Pod
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-12-26 15:09:49 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-12-26 15:09:49 +0100
commiteccdc4d715215b93b6b598d8cf3ac12e323f67e0 (patch)
tree45456bc181b6fe7d47cd6e740cd2ca3ec2d6cbcb /lib/Pod
parent580f5bb24e046b670b622bf4b70a2a5693f38599 (diff)
downloadperl-eccdc4d715215b93b6b598d8cf3ac12e323f67e0.tar.gz
Upgrade to podlators 2.2.1
Diffstat (limited to 'lib/Pod')
-rw-r--r--lib/Pod/Text.pm3
-rw-r--r--lib/Pod/t/man.t33
-rw-r--r--lib/Pod/t/pod-parser.t32
-rw-r--r--lib/Pod/t/text.t31
4 files changed, 93 insertions, 6 deletions
diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm
index fa1fd57263..23c8ae9860 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 7071ba8f83..419cce3ee6 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<eth>
.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 21817fea55..318a76bc15 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 <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.
@@ -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<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;
diff --git a/lib/Pod/t/text.t b/lib/Pod/t/text.t
index b4c772768e..2ef9aab879 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 <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.
@@ -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.
+
+###