summaryrefslogtreecommitdiff
path: root/lib/Pod/t
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2008-06-02 12:21:28 +0000
committerSteve Peters <steve@fisharerojo.org>2008-06-02 12:21:28 +0000
commit55595e835ecd270061d73c45c43db17eca4eee1f (patch)
tree1d2712e0d44cc2929e2372a6a3a0d5200bbca2f4 /lib/Pod/t
parent7029ff372354ea903b727328797cc0bb1e03625d (diff)
downloadperl-55595e835ecd270061d73c45c43db17eca4eee1f.tar.gz
Upgrade to podlators-2.1.0
p4raw-id: //depot/perl@33987
Diffstat (limited to 'lib/Pod/t')
-rw-r--r--lib/Pod/t/basic.t1
-rwxr-xr-xlib/Pod/t/color.t1
-rw-r--r--lib/Pod/t/filehandle.t1
-rw-r--r--lib/Pod/t/man-options.t103
-rw-r--r--lib/Pod/t/man.t28
-rw-r--r--lib/Pod/t/parselink.t1
-rw-r--r--lib/Pod/t/pod-parser.t1
-rwxr-xr-xlib/Pod/t/termcap.t1
-rw-r--r--lib/Pod/t/text-options.t1
-rw-r--r--lib/Pod/t/text.t1
10 files changed, 127 insertions, 12 deletions
diff --git a/lib/Pod/t/basic.t b/lib/Pod/t/basic.t
index 6d4b842bb0..603d108574 100644
--- a/lib/Pod/t/basic.t
+++ b/lib/Pod/t/basic.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: basic.t,v 1.11 2006-09-16 20:25:25 eagle Exp $
#
# basic.t -- Basic tests for podlators.
#
diff --git a/lib/Pod/t/color.t b/lib/Pod/t/color.t
index 0575b509cb..2f1668f88e 100755
--- a/lib/Pod/t/color.t
+++ b/lib/Pod/t/color.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: color.t,v 1.3 2006-01-28 22:31:50 eagle Exp $
#
# color.t -- Additional specialized tests for Pod::Text::Color.
#
diff --git a/lib/Pod/t/filehandle.t b/lib/Pod/t/filehandle.t
index 1b9b8d95bc..a53884d50d 100644
--- a/lib/Pod/t/filehandle.t
+++ b/lib/Pod/t/filehandle.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: filehandle.t,v 1.2 2006-09-16 20:25:25 eagle Exp $
#
# filehandle.t -- Test the parse_from_filehandle interface.
#
diff --git a/lib/Pod/t/man-options.t b/lib/Pod/t/man-options.t
new file mode 100644
index 0000000000..928d7542fa
--- /dev/null
+++ b/lib/Pod/t/man-options.t
@@ -0,0 +1,103 @@
+#!/usr/bin/perl -w
+#
+# man-options.t -- Additional tests for Pod::Man options.
+#
+# Copyright 2002, 2004, 2006, 2008 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.
+
+BEGIN {
+ chdir 't' if -d 't';
+ if ($ENV{PERL_CORE}) {
+ @INC = '../lib';
+ } else {
+ unshift (@INC, '../blib/lib');
+ }
+ unshift (@INC, '../blib/lib');
+ $| = 1;
+ print "1..2\n";
+}
+
+END {
+ print "not ok 1\n" unless $loaded;
+}
+
+use Pod::Man;
+
+$loaded = 1;
+print "ok 1\n";
+
+my $n = 2;
+while (<DATA>) {
+ my %options;
+ next until $_ eq "###\n";
+ while (<DATA>) {
+ last if $_ eq "###\n";
+ my ($option, $value) = split;
+ $options{$option} = $value;
+ }
+ open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
+ while (<DATA>) {
+ last if $_ eq "###\n";
+ print TMP $_;
+ }
+ close TMP;
+ my $parser = Pod::Man->new (%options) or die "Cannot create parser\n";
+ open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
+ $parser->parse_from_file ('tmp.pod', \*OUT);
+ close OUT;
+ open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
+ while (<TMP>) { last if /^\.nh/ }
+ my $output;
+ {
+ local $/;
+ $output = <TMP>;
+ }
+ close TMP;
+ unlink ('tmp.pod', 'out.tmp');
+ my $expected = '';
+ while (<DATA>) {
+ last if $_ eq "###\n";
+ $expected .= $_;
+ }
+ if ($output eq $expected) {
+ print "ok $n\n";
+ } else {
+ print "not ok $n\n";
+ print "Expected\n========\n$expected\nOutput\n======\n$output\n";
+ }
+ $n++;
+}
+
+# Below the marker are bits of POD and corresponding expected text output.
+# This is used to test specific features or problems with Pod::Man. The
+# input and output are separated by lines containing only ###.
+
+__DATA__
+
+###
+utf8 1
+###
+=head1 BEYONCÉ
+
+Beyoncé! Beyoncé! Beyoncé!!
+
+ Beyoncé! Beyoncé!
+ Beyoncé! Beyoncé!
+ Beyoncé! Beyoncé!
+
+Older versions did not convert Beyoncé in verbatim.
+###
+.SH "BEYONCÉ"
+.IX Header "BEYONCÉ"
+Beyoncé! Beyoncé! Beyoncé!!
+.PP
+.Vb 3
+\& Beyoncé! Beyoncé!
+\& Beyoncé! Beyoncé!
+\& Beyoncé! Beyoncé!
+.Ve
+.PP
+Older versions did not convert Beyoncé in verbatim.
+###
diff --git a/lib/Pod/t/man.t b/lib/Pod/t/man.t
index 5d4d2315b6..6b162177a5 100644
--- a/lib/Pod/t/man.t
+++ b/lib/Pod/t/man.t
@@ -1,9 +1,9 @@
#!/usr/bin/perl -w
-# $Id: man.t,v 1.12 2007-11-29 01:35:54 eagle Exp $
#
# man.t -- Additional specialized tests for Pod::Man.
#
-# Copyright 2002, 2003, 2004, 2006, 2007 by Russ Allbery <rra@stanford.edu>
+# Copyright 2002, 2003, 2004, 2006, 2007, 2008
+# 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.
@@ -17,7 +17,7 @@ BEGIN {
}
unshift (@INC, '../blib/lib');
$| = 1;
- print "1..22\n";
+ print "1..24\n";
}
END {
@@ -29,6 +29,9 @@ use Pod::Man;
$loaded = 1;
print "ok 1\n";
+# Test whether we can use binmode to set encoding.
+my $have_encoding = (eval { require PerlIO::encoding; 1 } and not $@);
+
my $parser = Pod::Man->new or die "Cannot create parser\n";
my $n = 2;
while (<DATA>) {
@@ -38,7 +41,7 @@ while (<DATA>) {
# We have a test in ISO 8859-1 encoding. Make sure that nothing strange
# happens if Perl thinks the world is Unicode. Wrap this in eval so that
# older versions of Perl don't croak.
- eval { binmode (\*TMP, ':encoding(iso-8859-1)') };
+ eval { binmode (\*TMP, ':encoding(iso-8859-1)') if $have_encoding };
while (<DATA>) {
last if $_ eq "###\n";
@@ -431,3 +434,20 @@ Don't escape `this' but do escape C<`this'> (and don't surround it in quotes).
.IX Header "Quote escaping"
Don't escape `this' but do escape \f(CW\`this\*(Aq\fR (and don't surround it in quotes).
###
+
+###
+=pod
+
+E<eth>
+###
+.PP
+\&\*(d-
+###
+
+###
+=head1 C<one> and C<two>
+###
+.ie n .SH """one"" and ""two"""
+.el .SH "\f(CWone\fP and \f(CWtwo\fP"
+.IX Header "one and two"
+###
diff --git a/lib/Pod/t/parselink.t b/lib/Pod/t/parselink.t
index 68bc3514bb..c5c2bb660b 100644
--- a/lib/Pod/t/parselink.t
+++ b/lib/Pod/t/parselink.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: parselink.t,v 1.1 2001/11/23 10:09:06 eagle Exp $
#
# parselink.t -- Tests for Pod::ParseLink.
#
diff --git a/lib/Pod/t/pod-parser.t b/lib/Pod/t/pod-parser.t
index 7b0f8c1bcf..21817fea55 100644
--- a/lib/Pod/t/pod-parser.t
+++ b/lib/Pod/t/pod-parser.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: pod-parser.t,v 1.2 2006-09-16 21:09:57 eagle Exp $
#
# pod-parser.t -- Tests for backward compatibility with Pod::Parser.
#
diff --git a/lib/Pod/t/termcap.t b/lib/Pod/t/termcap.t
index f93b82e17e..5ec98288f6 100755
--- a/lib/Pod/t/termcap.t
+++ b/lib/Pod/t/termcap.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: termcap.t,v 1.4 2006-01-28 22:31:50 eagle Exp $
#
# termcap.t -- Additional specialized tests for Pod::Text::Termcap.
#
diff --git a/lib/Pod/t/text-options.t b/lib/Pod/t/text-options.t
index 2a62a1bc15..5eb05d302f 100644
--- a/lib/Pod/t/text-options.t
+++ b/lib/Pod/t/text-options.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: text-options.t,v 1.6 2006-01-28 22:31:50 eagle Exp $
#
# text-options.t -- Additional tests for Pod::Text options.
#
diff --git a/lib/Pod/t/text.t b/lib/Pod/t/text.t
index b1995f29e4..f5654eaf25 100644
--- a/lib/Pod/t/text.t
+++ b/lib/Pod/t/text.t
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id: text.t,v 1.6 2007-09-12 00:20:08 eagle Exp $
#
# text.t -- Additional specialized tests for Pod::Text.
#