summaryrefslogtreecommitdiff
path: root/cpan/podlators/t
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-01-04 14:33:58 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-01-04 14:33:58 +0000
commit537bc13a66609cf3ecd8c17c041c2c619b619197 (patch)
tree5211fac74714ada511cb68f62788e4abcb29c163 /cpan/podlators/t
parentd2898d73a1ac5ef072641f07c70d9334e368d58a (diff)
downloadperl-537bc13a66609cf3ecd8c17c041c2c619b619197.tar.gz
Update podlators to CPAN version 2.5.0
[DELTA] 2013-01-02 Russ Allbery <rra@stanford.edu> * VERSION: podlators 2.5.0 released. * lib/Pod/Man.pm (guesswork): Extend a small-caps section through the punctuation that commonly appears in license disclaimers so that small caps isn't turned on and off at the boundaries of every word, producing unreadable *roff. * t/man.t: Test the updated small-caps behavior. * lib/Pod/Man.pm (new): Support a new errors option with values die, stderr, pod, and none. Convert the stderr option to the errors option with value stderr. (#39007) (end_document): Die if errors was set to die and there were POD syntax errors. * lib/Pod/Text.pm (new): Likewise. (end_document): Likewise. * scripts/pod2man: Support a new --errors option that sets the underlying errors formatter option and default to dying on POD syntax errors. * scripts/pod2text: Likewise. * t/man-options.t: Add support for catching exceptions during formatting. Test valid and invalid errors settings. * t/text-options.t: Likewise. * lib/Pod/Man.pm (cmd_l): Add nourls option to suppress the URL from L<> formatting codes that contain anchor text. (#62210) * lib/Pod/Text.pm (cmd_l): Likewise. * scripts/pod2man: New --nourls option to set the corresponding option in Pod::Man. * scripts/pod2text: Likewise for Pod::Text. * t/man-options.t: Test new nourls option. * t/text-options.t: Likewise. * lib/Pod/Man.pm (outindex): Also collapse consecutive whitespace in index term text. * t/man.t: Test for handling of index terms containing whitespace. 2013-01-02 Kevin Ryde <user42@zip.com.au> * lib/Pod/Man.pm (outindex): Remove newlines from index term text since *roff quotes don't span lines. (#82332) 2012-06-01 Russ Allbery <rra@stanford.edu> * VERSION: podlators 2.4.2 released. * t/text-encoding.t: Remove the test of a POD document without an encoding. We previously tested that this interpreted the document as ISO 8859-1, but Pod::Simple behavior has changed so that the test started failing, plus Pod::Simple now warns about a missing =encoding. (#77553)
Diffstat (limited to 'cpan/podlators/t')
-rw-r--r--cpan/podlators/t/man-options.t112
-rw-r--r--cpan/podlators/t/man.t42
-rw-r--r--cpan/podlators/t/text-options.t105
3 files changed, 247 insertions, 12 deletions
diff --git a/cpan/podlators/t/man-options.t b/cpan/podlators/t/man-options.t
index 6b4def7b01..d35b88e287 100644
--- a/cpan/podlators/t/man-options.t
+++ b/cpan/podlators/t/man-options.t
@@ -1,8 +1,9 @@
#!/usr/bin/perl -w
#
-# man-options.t -- Additional tests for Pod::Man options.
+# Additional tests for Pod::Man options.
#
-# Copyright 2002, 2004, 2006, 2008, 2009, 2012 Russ Allbery <rra@stanford.edu>
+# Copyright 2002, 2004, 2006, 2008, 2009, 2012, 2013
+# 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.
@@ -18,7 +19,7 @@ BEGIN {
use strict;
-use Test::More tests => 10;
+use Test::More tests => 25;
BEGIN { use_ok ('Pod::Man') }
# Redirect stderr to a file.
@@ -53,7 +54,8 @@ while (<DATA>) {
isa_ok ($parser, 'Pod::Man', 'Parser object');
open (OUT, "> out$$.tmp") or die "Cannot create out$$.tmp: $!\n";
stderr_save;
- $parser->parse_from_file ("tmp$$.pod", \*OUT);
+ eval { $parser->parse_from_file ("tmp$$.pod", \*OUT) };
+ my $exception = $@;
stderr_restore;
close OUT;
my $accents = 0;
@@ -83,6 +85,10 @@ while (<DATA>) {
close ERR;
$errors =~ s/\Qtmp$$.pod/tmp.pod/g;
1 while unlink ("out$$.err");
+ if ($exception) {
+ $exception =~ s/ at .*//;
+ $errors .= "EXCEPTION: $exception";
+ }
$expected = '';
while (<DATA>) {
last if $_ eq "###\n";
@@ -158,3 +164,101 @@ Bar.
###
tmp.pod around line 7: You forgot a '=back' before '=head1'
###
+
+###
+nourls 1
+###
+=head1 URL suppression
+
+L<anchor|http://www.example.com/>
+###
+.SH "URL suppression"
+.IX Header "URL suppression"
+anchor
+###
+###
+
+###
+errors stderr
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+.IP "Foo" 4
+.IX Item "Foo"
+Bar.
+.SH "NEXT"
+.IX Header "NEXT"
+###
+tmp.pod around line 7: You forgot a '=back' before '=head1'
+###
+
+###
+errors die
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+.IP "Foo" 4
+.IX Item "Foo"
+Bar.
+.SH "NEXT"
+.IX Header "NEXT"
+###
+tmp.pod around line 7: You forgot a '=back' before '=head1'
+EXCEPTION: POD document had syntax errors
+###
+
+###
+errors pod
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+.IP "Foo" 4
+.IX Item "Foo"
+Bar.
+.SH "NEXT"
+.IX Header "NEXT"
+.SH "POD ERRORS"
+.IX Header "POD ERRORS"
+Hey! \fBThe above document had some coding errors, which are explained below:\fR
+.IP "Around line 7:" 4
+.IX Item "Around line 7:"
+You forgot a '=back' before '=head1'
+###
+###
+
+###
+errors none
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+.IP "Foo" 4
+.IX Item "Foo"
+Bar.
+.SH "NEXT"
+.IX Header "NEXT"
+###
+###
diff --git a/cpan/podlators/t/man.t b/cpan/podlators/t/man.t
index 3a07e80c81..f8a391e85e 100644
--- a/cpan/podlators/t/man.t
+++ b/cpan/podlators/t/man.t
@@ -1,8 +1,8 @@
#!/usr/bin/perl -w
#
-# man.t -- Additional specialized tests for Pod::Man.
+# Additional specialized tests for Pod::Man.
#
-# Copyright 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2012
+# Copyright 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2012, 2013
# Russ Allbery <rra@stanford.edu>
#
# This program is free software; you may redistribute it and/or modify it
@@ -19,7 +19,7 @@ BEGIN {
use strict;
-use Test::More tests => 33;
+use Test::More tests => 35;
BEGIN { use_ok ('Pod::Man') }
# Test whether we can use binmode to set encoding.
@@ -499,7 +499,7 @@ This is a L<link|http://www.example.com/> to a URL.
###
.SH "LINK TO URL"
.IX Header "LINK TO URL"
-This is a link <http://www.example.com/> to a \s-1URL\s0.
+This is a link <http://www.example.com/> to a \s-1URL.\s0
###
###
@@ -550,3 +550,37 @@ L<[perl #12345]|https://rt.cpan.org/12345>
.IX Header "RT LINK"
[perl #12345] <https://rt.cpan.org/12345>
###
+
+###
+=head1 Multiline XZ<><>
+
+Something something X<this is
+one index term>
+###
+.SH "Multiline X<>"
+.IX Header "Multiline X<>"
+Something something
+.IX Xref "this is one index term"
+###
+
+###
+=head1 Uppercase License
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+###
+.SH "Uppercase License"
+.IX Header "Uppercase License"
+\&\s-1THE SOFTWARE IS PROVIDED \*(L"AS IS\*(R", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\s0
+###
diff --git a/cpan/podlators/t/text-options.t b/cpan/podlators/t/text-options.t
index e49b746b18..06bf081843 100644
--- a/cpan/podlators/t/text-options.t
+++ b/cpan/podlators/t/text-options.t
@@ -1,8 +1,9 @@
#!/usr/bin/perl -w
#
-# text-options.t -- Additional tests for Pod::Text options.
+# Additional tests for Pod::Text options.
#
-# Copyright 2002, 2004, 2006, 2008, 2009, 2012 Russ Allbery <rra@stanford.edu>
+# Copyright 2002, 2004, 2006, 2008, 2009, 2012, 2013
+# 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.
@@ -18,7 +19,7 @@ BEGIN {
use strict;
-use Test::More tests => 19;
+use Test::More tests => 34;
BEGIN { use_ok ('Pod::Text') }
# Redirect stderr to a file.
@@ -53,7 +54,8 @@ while (<DATA>) {
isa_ok ($parser, 'Pod::Text', 'Parser object');
open (OUT, "> out$$.tmp") or die "Cannot create out$$.tmp: $!\n";
stderr_save;
- $parser->parse_from_file ("tmp$$.pod", \*OUT);
+ eval { $parser->parse_from_file ("tmp$$.pod", \*OUT) };
+ my $exception = $@;
stderr_restore;
close OUT;
open (TMP, "out$$.tmp") or die "Cannot open out$$.tmp: $!\n";
@@ -79,6 +81,10 @@ while (<DATA>) {
close ERR;
$errors =~ s/\Qtmp$$.pod/tmp.pod/g;
1 while unlink ("out$$.err");
+ if ($exception) {
+ $exception =~ s/ at .*//;
+ $errors .= "EXCEPTION: $exception";
+ }
$expected = '';
while (<DATA>) {
last if $_ eq "###\n";
@@ -254,3 +260,94 @@ NEXT
###
tmp.pod around line 7: You forgot a '=back' before '=head1'
###
+
+###
+nourls 1
+###
+=head1 URL suppression
+
+L<anchor|http://www.example.com/>
+###
+URL suppression
+ anchor
+
+###
+###
+
+###
+errors stderr
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+ Foo Bar.
+
+NEXT
+###
+tmp.pod around line 7: You forgot a '=back' before '=head1'
+###
+
+###
+errors die
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+ Foo Bar.
+
+NEXT
+###
+tmp.pod around line 7: You forgot a '=back' before '=head1'
+EXCEPTION: POD document had syntax errors
+###
+
+###
+errors pod
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+ Foo Bar.
+
+NEXT
+POD ERRORS
+ Hey! The above document had some coding errors, which are explained
+ below:
+
+ Around line 7:
+ You forgot a '=back' before '=head1'
+
+###
+###
+
+###
+errors none
+###
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+###
+ Foo Bar.
+
+NEXT
+###
+###