summaryrefslogtreecommitdiff
path: root/cpan/podlators
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2018-07-03 13:36:04 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2018-07-03 17:29:23 +0100
commitf97008e2f5934e56fd1dbd3d685308da14fddb30 (patch)
tree51bf186e595351107fd25a37e9c630d7571344ea /cpan/podlators
parent898be3f703bb071479564da92b010415f3f73f4e (diff)
downloadperl-f97008e2f5934e56fd1dbd3d685308da14fddb30.tar.gz
Upgrade podlators from version 4.10 to 4.11
(This includes the former blead customization.)
Diffstat (limited to 'cpan/podlators')
-rw-r--r--cpan/podlators/Makefile.PL58
-rw-r--r--cpan/podlators/lib/Pod/Man.pm45
-rw-r--r--cpan/podlators/lib/Pod/ParseLink.pm40
-rw-r--r--cpan/podlators/lib/Pod/Text.pm42
-rw-r--r--cpan/podlators/lib/Pod/Text/Color.pm99
-rw-r--r--cpan/podlators/lib/Pod/Text/Overstrike.pm50
-rw-r--r--cpan/podlators/lib/Pod/Text/Termcap.pm130
-rw-r--r--cpan/podlators/scripts/pod2man.PL46
-rw-r--r--cpan/podlators/scripts/pod2text.PL40
-rw-r--r--cpan/podlators/t/data/basic.cap10
-rw-r--r--cpan/podlators/t/data/basic.clr10
-rw-r--r--cpan/podlators/t/data/basic.man10
-rw-r--r--cpan/podlators/t/data/basic.ovr10
-rw-r--r--cpan/podlators/t/data/basic.pod11
-rw-r--r--cpan/podlators/t/data/basic.txt10
-rw-r--r--cpan/podlators/t/data/snippets/README4
-rw-r--r--cpan/podlators/t/data/snippets/color/escape-wrapping19
-rw-r--r--cpan/podlators/t/data/snippets/color/tag-width35
-rw-r--r--cpan/podlators/t/data/snippets/color/tag-wrapping19
-rw-r--r--cpan/podlators/t/data/snippets/color/width22
-rw-r--r--cpan/podlators/t/data/snippets/color/wrapping11
-rw-r--r--cpan/podlators/t/data/snippets/man/error-none2
-rw-r--r--cpan/podlators/t/data/snippets/man/uppercase-license24
-rw-r--r--cpan/podlators/t/data/snippets/termcap/escape-wrapping19
-rw-r--r--cpan/podlators/t/data/snippets/termcap/tag-width35
-rw-r--r--cpan/podlators/t/data/snippets/termcap/tag-wrapping19
-rw-r--r--cpan/podlators/t/data/snippets/termcap/width23
-rw-r--r--cpan/podlators/t/data/snippets/termcap/wrapping11
-rw-r--r--cpan/podlators/t/docs/pod-spelling.t4
-rw-r--r--cpan/podlators/t/docs/pod.t4
-rw-r--r--cpan/podlators/t/docs/spdx-license.t120
-rw-r--r--cpan/podlators/t/docs/synopsis.t4
-rw-r--r--cpan/podlators/t/docs/urls.t95
-rw-r--r--cpan/podlators/t/general/basic.t9
-rw-r--r--cpan/podlators/t/general/filehandle.t4
-rw-r--r--cpan/podlators/t/general/pod-parser.t4
-rw-r--r--cpan/podlators/t/lib/Test/Podlators.pm14
-rw-r--r--cpan/podlators/t/lib/Test/RRA.pm8
-rw-r--r--cpan/podlators/t/lib/Test/RRA/Config.pm8
-rw-r--r--cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm8
-rw-r--r--cpan/podlators/t/man/devise-date.t4
-rw-r--r--cpan/podlators/t/man/devise-title.t4
-rw-r--r--cpan/podlators/t/man/empty.t4
-rw-r--r--cpan/podlators/t/man/heading.t4
-rw-r--r--cpan/podlators/t/man/no-encode.t4
-rw-r--r--cpan/podlators/t/man/snippets.t4
-rw-r--r--cpan/podlators/t/man/utf8-io.t4
-rw-r--r--cpan/podlators/t/parselink/basic.t4
-rw-r--r--cpan/podlators/t/style/minimum-version.t4
-rw-r--r--cpan/podlators/t/style/module-version.t10
-rw-r--r--cpan/podlators/t/style/strict.t4
-rw-r--r--cpan/podlators/t/text/basic.t6
-rw-r--r--cpan/podlators/t/text/color.t117
-rw-r--r--cpan/podlators/t/text/empty.t6
-rw-r--r--cpan/podlators/t/text/encoding.t6
-rw-r--r--cpan/podlators/t/text/options.t4
-rw-r--r--cpan/podlators/t/text/overstrike.t6
-rw-r--r--cpan/podlators/t/text/perlio.t6
-rw-r--r--cpan/podlators/t/text/termcap.t124
-rw-r--r--cpan/podlators/t/text/utf8.t6
60 files changed, 1013 insertions, 454 deletions
diff --git a/cpan/podlators/Makefile.PL b/cpan/podlators/Makefile.PL
index 0a6ad65969..a2008fefc7 100644
--- a/cpan/podlators/Makefile.PL
+++ b/cpan/podlators/Makefile.PL
@@ -4,11 +4,13 @@
# which only supports that build method, and because it is a dependency of
# other build systems like Module::Build.
#
-# Copyright 1999, 2000, 2001, 2008, 2010, 2012, 2014, 2015, 2016
+# Copyright 1999-2001, 2008, 2010, 2012, 2014-2016, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
@@ -18,6 +20,25 @@ use Config;
use ExtUtils::MakeMaker;
use File::Spec;
+# Determine the version of the distribution so that we can construct the
+# provides metadata that unfortunately ExtUtils::MakeMaker does not build.
+# This is a very simple $VERSION parser, since it only has to handle the
+# syntax Pod::Man uses.
+#
+# Returns: Distribution version as a string
+sub dist_version {
+ open(my $fh, '<', File::Spec->catfile('lib', 'Pod', 'Man.pm'))
+ or die "$0: cannot open lib/Pod/Man.pm: $!\n";
+ while (defined(my $line = <$fh>)) {
+ if ($line =~ m{ \A \$VERSION \s+ = \s+ '([^\']+)' }xms) {
+ close($fh) or die "$0: cannot close lib/Pod/Man.pm\n";
+ return $1;
+ }
+ }
+ close($fh) or die "$0: cannot close lib/Pod/Man.pm\n";
+ die "$0: cannot find version in lib/Pod/Man.pm\n";
+}
+
# Generate full paths for scripts distributed in the bin directory. Appends
# the .com extension to scripts on VMS, unless they already have the .PL
# extension.
@@ -59,7 +80,8 @@ sub man1pod {
# The hash of all the metadata. This will be modified before WriteMakefile to
# remove keys not supported by the local version of ExtUtils::MakeMaker.
-my %metadata = (
+my $dist_version = dist_version();
+my %metadata = (
NAME => 'Pod',
DISTNAME => 'podlators',
ABSTRACT => 'Convert POD data to various other formats',
@@ -106,14 +128,40 @@ my %metadata = (
# Additional metadata.
META_ADD => {
'meta-spec' => { version => 2 },
- resources => {
+ provides => {
+ 'Pod::Man' => {
+ file => 'lib/Pod/Man.pm',
+ version => $dist_version,
+ },
+ 'Pod::ParseLink' => {
+ file => 'lib/Pod/ParseLink.pm',
+ version => $dist_version,
+ },
+ 'Pod::Text' => {
+ file => 'lib/Pod/Text.pm',
+ version => $dist_version,
+ },
+ 'Pod::Text::Color' => {
+ file => 'lib/Pod/Text/Color.pm',
+ version => $dist_version,
+ },
+ 'Pod::Text::Overstrike' => {
+ file => 'lib/Pod/Text/Overstrike.pm',
+ version => $dist_version,
+ },
+ 'Pod::Text::Termcap' => {
+ file => 'lib/Pod/Text/Termcap.pm',
+ version => $dist_version,
+ },
+ },
+ resources => {
bugtracker => {
mailto => 'bug-podlators@rt.cpan.org',
web => 'https://rt.cpan.org/Dist/Display.html?Name=podlators',
},
- homepage => 'http://www.eyrie.org/~eagle/software/podlators/',
+ homepage => 'https://www.eyrie.org/~eagle/software/podlators/',
repository => {
- url => 'git://github.com/rra/podlators.git',
+ url => 'https://github.com/rra/podlators.git',
web => 'https://github.com/rra/podlators',
type => 'git',
},
diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
index a737e5b3e9..6ebab1e0e5 100644
--- a/cpan/podlators/lib/Pod/Man.pm
+++ b/cpan/podlators/lib/Pod/Man.pm
@@ -1,4 +1,4 @@
-# Pod::Man -- Convert POD data to formatted *roff input.
+# Convert POD data to formatted *roff input.
#
# This module translates POD documentation into *roff markup using the man
# macro set, and is intended for converting POD documents written as Unix
@@ -6,18 +6,7 @@
# a replacement for the pod2man command distributed with versions of Perl
# prior to 5.6.
#
-# Perl core hackers, please note that this module is also separately
-# maintained outside of the Perl core as part of the podlators. Please send
-# me any patches at the address above in addition to sending them to the
-# standard Perl mailing lists.
-#
-# Written by Russ Allbery <rra@cpan.org>
-# Substantial contributions by Sean Burke <sburke@cpan.org>
-# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-# 2010, 2012, 2013, 2014, 2015, 2016, 2017 Russ Allbery <rra@cpan.org>
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
##############################################################################
# Modules and declarations
@@ -43,7 +32,7 @@ BEGIN {
@ISA = qw(Pod::Simple);
-$VERSION = '4.10';
+$VERSION = '4.11';
# Set the debugging level. If someone has inserted a debug function into this
# class already, use that. Otherwise, use any Pod::Simple debug function
@@ -140,6 +129,7 @@ sub new {
$self->no_errata_section (0);
$self->complain_stderr (0);
} elsif ($$self{errors} eq 'none') {
+ $self->no_errata_section (1);
$self->no_whining (1);
} else {
croak (qq(Invalid errors setting: "$$self{errors}"));
@@ -1651,9 +1641,9 @@ sub preamble_template {
__END__
=for stopwords
-en em ALLCAPS teeny fixedbold fixeditalic fixedbolditalic stderr utf8
-UTF-8 Allbery Sean Burke Ossanna Solaris formatters troff uppercased
-Christiansen nourls parsers Kernighan lquote rquote
+en em ALLCAPS teeny fixedbold fixeditalic fixedbolditalic stderr utf8 UTF-8
+Allbery Sean Burke Ossanna Solaris formatters troff uppercased Christiansen
+nourls parsers Kernighan lquote rquote
=head1 NAME
@@ -2014,16 +2004,17 @@ only matters for troff output.
=head1 AUTHOR
-Russ Allbery <rra@cpan.org>, based I<very> heavily on the original
-B<pod2man> by Tom Christiansen <tchrist@mox.perl.com>. The modifications to
-work with Pod::Simple instead of Pod::Parser were originally contributed by
-Sean Burke (but I've since hacked them beyond recognition and all bugs are
-mine).
+Russ Allbery <rra@cpan.org>, based I<very> heavily on the original B<pod2man>
+by Tom Christiansen <tchrist@mox.perl.com>. The modifications to work with
+Pod::Simple instead of Pod::Parser were originally contributed by Sean Burke
+<sburke@cpan.org> (but I've since hacked them beyond recognition and all bugs
+are mine).
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-2009, 2010, 2012, 2013, 2014, 2015, 2016, 2017 Russ Allbery <rra@cpan.org>
+Copyright 1999-2010, 2012-2018 Russ Allbery <rra@cpan.org>
+
+Substantial contributions by Sean Burke <sburke@cpan.org>.
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
@@ -2044,7 +2035,11 @@ documentation on writing manual pages if you've not done it before and
aren't familiar with the conventions.
The current version of this module is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
+L<https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
Perl core distribution as of 5.6.0.
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/lib/Pod/ParseLink.pm b/cpan/podlators/lib/Pod/ParseLink.pm
index 9a1627079b..0be5323973 100644
--- a/cpan/podlators/lib/Pod/ParseLink.pm
+++ b/cpan/podlators/lib/Pod/ParseLink.pm
@@ -1,19 +1,11 @@
-# Pod::ParseLink -- Parse an L<> formatting code in POD text.
-#
-# Copyright 2001, 2008, 2009, 2014 by Russ Allbery <rra@cpan.org>
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# Parse an L<> formatting code in POD text.
#
# This module implements parsing of the text of an L<> formatting code as
# defined in perlpodspec. It should be suitable for any POD formatter. It
# exports only one function, parselink(), which returns the five-item parse
# defined in perlpodspec.
#
-# Perl core hackers, please note that this module is also separately
-# maintained outside of the Perl core as part of the podlators. Please send
-# me any patches at the address above in addition to sending them to the
-# standard Perl mailing lists.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
##############################################################################
# Modules and declarations
@@ -31,7 +23,7 @@ use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(parselink);
-$VERSION = '4.10';
+$VERSION = '4.11';
##############################################################################
# Implementation
@@ -114,13 +106,13 @@ sub parselink {
1;
__END__
+=for stopwords
+markup Allbery URL
+
=head1 NAME
Pod::ParseLink - Parse an LE<lt>E<gt> formatting code in POD text
-=for stopwords
-markup Allbery URL
-
=head1 SYNOPSIS
use Pod::ParseLink;
@@ -173,22 +165,26 @@ the section may be necessary depending on whether the translator wants to
consider markup in sections to be significant when resolving links. See
L<perlpodspec> for more information.
-=head1 SEE ALSO
-
-L<Pod::Parser>
-
-The current version of this module is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>.
-
=head1 AUTHOR
Russ Allbery <rra@cpan.org>.
=head1 COPYRIGHT AND LICENSE
-Copyright 2001, 2008, 2009 Russ Allbery <rra@cpan.org>.
+Copyright 2001, 2008, 2009, 2014, 2018 Russ Allbery <rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
+=head1 SEE ALSO
+
+L<Pod::Parser>
+
+The current version of this module is always available from its web site at
+L<https://www.eyrie.org/~eagle/software/podlators/>.
+
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/lib/Pod/Text.pm b/cpan/podlators/lib/Pod/Text.pm
index f73b4af2b9..b05730ef47 100644
--- a/cpan/podlators/lib/Pod/Text.pm
+++ b/cpan/podlators/lib/Pod/Text.pm
@@ -6,16 +6,7 @@
# seemed to produce better output. It uses Pod::Parser and is designed to be
# very easy to subclass.
#
-# Perl core hackers, please note that this module is also separately
-# maintained outside of the Perl core as part of the podlators. Please send
-# me any patches at the address above in addition to sending them to the
-# standard Perl mailing lists.
-#
-# Copyright 1999, 2000, 2001, 2002, 2004, 2006, 2008, 2009, 2012, 2013, 2014,
-# 2015, 2016 Russ Allbery <rra@cpan.org>
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
##############################################################################
# Modules and declarations
@@ -39,7 +30,7 @@ use Pod::Simple ();
# We have to export pod2text for backward compatibility.
@EXPORT = qw(pod2text);
-$VERSION = '4.10';
+$VERSION = '4.11';
# Ensure that $Pod::Simple::nbsp and $Pod::Simple::shy are available. Code
# taken from Pod::Simple 3.32, but was only added in 3.30.
@@ -126,6 +117,7 @@ sub new {
$self->no_errata_section (0);
$self->complain_stderr (0);
} elsif ($$self{opt_errors} eq 'none') {
+ $self->no_errata_section (1);
$self->no_whining (1);
} else {
croak (qq(Invalid errors setting: "$$self{errors}"));
@@ -790,7 +782,7 @@ Pod::Text - Convert POD data to formatted text
=head1 SYNOPSIS
use Pod::Text;
- my $parser = Pod::Text->new (sentence => 0, width => 78);
+ my $parser = Pod::Text->new (sentence => 1, width => 78);
# Read POD from STDIN and write to STDOUT.
$parser->parse_from_filehandle;
@@ -888,7 +880,7 @@ marks are added around CE<lt>> text.
If set to a true value, Pod::Text will assume that each sentence ends in two
spaces, and will try to preserve that spacing. If set to false, all
consecutive whitespace in non-verbatim paragraphs is compressed into a
-single space. Defaults to true.
+single space. Defaults to false.
=item stderr
@@ -1004,14 +996,6 @@ sequences, although it wasn't turned on by default and it was problematic to
get it to work at all. This rewrite doesn't even try to do that, but a
subclass of it does. Look for L<Pod::Text::Termcap>.
-=head1 SEE ALSO
-
-L<Pod::Simple>, L<Pod::Text::Termcap>, L<perlpod(1)>, L<pod2text(1)>
-
-The current version of this module is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
-Perl core distribution as of 5.6.0.
-
=head1 AUTHOR
Russ Allbery <rra@cpan.org>, based I<very> heavily on the original
@@ -1022,10 +1006,22 @@ how to use Pod::Simple.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2000, 2001, 2002, 2004, 2006, 2008, 2009, 2012, 2013, 2014,
-2015, 2016 Russ Allbery <rra@cpan.org>
+Copyright 1999-2002, 2004, 2006, 2008-2009, 2012-2016, 2018 Russ Allbery
+<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
+=head1 SEE ALSO
+
+L<Pod::Simple>, L<Pod::Text::Termcap>, L<perlpod(1)>, L<pod2text(1)>
+
+The current version of this module is always available from its web site at
+L<https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
+Perl core distribution as of 5.6.0.
+
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/lib/Pod/Text/Color.pm b/cpan/podlators/lib/Pod/Text/Color.pm
index fa1aadb463..8d956f2a5d 100644
--- a/cpan/podlators/lib/Pod/Text/Color.pm
+++ b/cpan/podlators/lib/Pod/Text/Color.pm
@@ -1,14 +1,10 @@
-# Pod::Text::Color -- Convert POD data to formatted color ASCII text
+# Convert POD data to formatted color ASCII text
#
# This is just a basic proof of concept. It should later be modified to make
# better use of color, take options changing what colors are used for what
# text, and the like.
#
-# Copyright 1999, 2001, 2004, 2006, 2008, 2009, 2014
-# Russ Allbery <rra@cpan.org>
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
##############################################################################
# Modules and declarations
@@ -21,13 +17,13 @@ use strict;
use warnings;
use Pod::Text ();
-use Term::ANSIColor qw(colored);
+use Term::ANSIColor qw(color colored);
use vars qw(@ISA $VERSION);
@ISA = qw(Pod::Text);
-$VERSION = '4.10';
+$VERSION = '4.11';
##############################################################################
# Overrides
@@ -37,6 +33,7 @@ $VERSION = '4.10';
sub cmd_head1 {
my ($self, $attrs, $text) = @_;
$text =~ s/\s+$//;
+ local $Term::ANSIColor::EACHLINE = "\n";
$self->SUPER::cmd_head1 ($attrs, colored ($text, 'bold'));
}
@@ -52,9 +49,27 @@ sub cmd_b { return colored ($_[2], 'bold') }
sub cmd_f { return colored ($_[2], 'cyan') }
sub cmd_i { return colored ($_[2], 'yellow') }
+# Analyze a single line and return any formatting codes in effect at the end
+# of that line.
+sub end_format {
+ my ($self, $line) = @_;
+ my $reset = color ('reset');
+ my $current;
+ while ($line =~ /(\e\[[\d;]+m)/g) {
+ my $code = $1;
+ if ($code eq $reset) {
+ undef $current;
+ } else {
+ $current .= $code;
+ }
+ }
+ return $current;
+}
+
# Output any included code in green.
sub output_code {
my ($self, $code) = @_;
+ local $Term::ANSIColor::EACHLINE = "\n";
$code = colored ($code, 'green');
$self->output ($code);
}
@@ -77,19 +92,48 @@ sub wrap {
my $spaces = ' ' x $$self{MARGIN};
my $width = $$self{opt_width} - $$self{MARGIN};
- # We have to do $shortchar and $longchar in variables because the
+ # $codes matches a single special sequence. $char matches any number of
+ # special sequences preceding a single character other than a newline.
+ # $shortchar matches some sequence of $char ending in codes followed by
+ # whitespace or the end of the string. $longchar matches exactly $width
+ # $chars, used when we have to truncate and hard wrap.
+ #
+ # $shortchar and $longchar are created in a slightly odd way because the
# construct ${char}{0,$width} didn't do the right thing until Perl 5.8.x.
- my $char = '(?:(?:\e\[[\d;]+m)*[^\n])';
- my $shortchar = $char . "{0,$width}";
- my $longchar = $char . "{$width}";
+ my $code = '(?:\e\[[\d;]+m)';
+ my $char = "(?>$code*[^\\n])";
+ my $shortchar = '^(' . $char . "{0,$width}(?>$code*)" . ')(?:\s+|\z)';
+ my $longchar = '^(' . $char . "{$width})";
while (length > $width) {
- if (s/^($shortchar)\s+// || s/^($longchar)//) {
+ if (s/$shortchar// || s/$longchar//) {
$output .= $spaces . $1 . "\n";
} else {
last;
}
}
$output .= $spaces . $_;
+
+ # less -R always resets terminal attributes at the end of each line, so we
+ # need to clear attributes at the end of lines and then set them again at
+ # the start of the next line. This requires a second pass through the
+ # wrapped string, accumulating any attributes we see, remembering them,
+ # and then inserting the appropriate sequences at the newline.
+ if ($output =~ /\n/) {
+ my @lines = split (/\n/, $output);
+ my $start_format;
+ for my $line (@lines) {
+ if ($start_format && $line =~ /\S/) {
+ $line =~ s/^(\s*)(\S)/$1$start_format$2/;
+ }
+ $start_format = $self->end_format ($line);
+ if ($start_format) {
+ $line .= color ('reset');
+ }
+ }
+ $output = join ("\n", @lines);
+ }
+
+ # Fix up trailing whitespace and return the results.
$output =~ s/\s+$/\n\n/;
$output;
}
@@ -101,13 +145,13 @@ sub wrap {
1;
__END__
+=for stopwords
+Allbery
+
=head1 NAME
Pod::Text::Color - Convert POD data to formatted color ASCII text
-=for stopwords
-Allbery
-
=head1 SYNOPSIS
use Pod::Text::Color;
@@ -135,23 +179,28 @@ This is just a basic proof of concept. It should be seriously expanded to
support configurable coloration via options passed to the constructor, and
B<pod2text> should be taught about those.
-=head1 SEE ALSO
-
-L<Pod::Text>, L<Pod::Simple>
-
-The current version of this module is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
-Perl core distribution as of 5.6.0.
-
=head1 AUTHOR
Russ Allbery <rra@cpan.org>.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2001, 2004, 2006, 2008, 2009 Russ Allbery <rra@cpan.org>.
+Copyright 1999, 2001, 2004, 2006, 2008, 2009, 2018 Russ Allbery
+<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
+=head1 SEE ALSO
+
+L<Pod::Text>, L<Pod::Simple>
+
+The current version of this module is always available from its web site at
+L<https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
+Perl core distribution as of 5.6.0.
+
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/lib/Pod/Text/Overstrike.pm b/cpan/podlators/lib/Pod/Text/Overstrike.pm
index d0ce7680aa..92a3a9330e 100644
--- a/cpan/podlators/lib/Pod/Text/Overstrike.pm
+++ b/cpan/podlators/lib/Pod/Text/Overstrike.pm
@@ -1,4 +1,4 @@
-# Pod::Text::Overstrike -- Convert POD data to formatted overstrike text
+# Convert POD data to formatted overstrike text
#
# This was written because the output from:
#
@@ -11,13 +11,7 @@
# and because both Pod::Text::Color and Pod::Text::Termcap are not device
# independent.
#
-# Created by Joe Smith <Joe.Smith@inwap.com> 30-Nov-2000
-# (based on Pod::Text::Color by Russ Allbery <rra@cpan.org>)
-# Copyright 2000 Joe Smith <Joe.Smith@inwap.com>.
-# Copyright 2001, 2004, 2008, 2014 Russ Allbery <rra@cpan.org>.
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
##############################################################################
# Modules and declarations
@@ -35,7 +29,7 @@ use Pod::Text ();
@ISA = qw(Pod::Text);
-$VERSION = '4.10';
+$VERSION = '4.11';
##############################################################################
# Overrides
@@ -141,15 +135,12 @@ sub wrap {
1;
__END__
-=head1 NAME
-
=for stopwords
-overstrike
+overstrike overstruck Overstruck Allbery terminal's
-Pod::Text::Overstrike - Convert POD data to formatted overstrike text
+=head1 NAME
-=for stopwords
-overstruck Overstruck Allbery terminal's
+Pod::Text::Overstrike - Convert POD data to formatted overstrike text
=head1 SYNOPSIS
@@ -185,25 +176,30 @@ Currently, the outermost formatting instruction wins, so for example
underlined text inside a region of bold text is displayed as simply bold.
There may be some better approach possible.
-=head1 SEE ALSO
-
-L<Pod::Text>, L<Pod::Simple>
-
-The current version of this module is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
-Perl core distribution as of 5.6.0.
-
=head1 AUTHOR
-Joe Smith <Joe.Smith@inwap.com>, using the framework created by Russ Allbery
-<rra@cpan.org>.
+Originally written by Joe Smith <Joe.Smith@inwap.com>, using the framework
+created by Russ Allbery <rra@cpan.org>. Subsequently updated by Russ Allbery.
=head1 COPYRIGHT AND LICENSE
-Copyright 2000 by Joe Smith <Joe.Smith@inwap.com>.
-Copyright 2001, 2004, 2008 by Russ Allbery <rra@cpan.org>.
+Copyright 2000 by Joe Smith <Joe.Smith@inwap.com>
+
+Copyright 2001, 2004, 2008, 2014, 2018 by Russ Allbery <rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
+=head1 SEE ALSO
+
+L<Pod::Text>, L<Pod::Simple>
+
+The current version of this module is always available from its web site at
+L<https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
+Perl core distribution as of 5.6.0.
+
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/lib/Pod/Text/Termcap.pm b/cpan/podlators/lib/Pod/Text/Termcap.pm
index f015cfce59..d36ba4f518 100644
--- a/cpan/podlators/lib/Pod/Text/Termcap.pm
+++ b/cpan/podlators/lib/Pod/Text/Termcap.pm
@@ -1,14 +1,10 @@
-# Pod::Text::Termcap -- Convert POD data to ASCII text with format escapes.
+# Convert POD data to ASCII text with format escapes.
#
# This is a simple subclass of Pod::Text that overrides a few key methods to
# output the right termcap escape sequences for formatted text on the current
# terminal type.
#
-# Copyright 1999, 2001, 2002, 2004, 2006, 2008, 2009, 2014, 2015
-# Russ Allbery <rra@cpan.org>
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
##############################################################################
# Modules and declarations
@@ -28,7 +24,7 @@ use vars qw(@ISA $VERSION);
@ISA = qw(Pod::Text);
-$VERSION = '4.10';
+$VERSION = '4.11';
##############################################################################
# Overrides
@@ -37,9 +33,8 @@ $VERSION = '4.10';
# In the initialization method, grab our terminal characteristics as well as
# do all the stuff we normally do.
sub new {
- my ($self, @args) = @_;
+ my ($self, %args) = @_;
my ($ospeed, $term, $termios);
- $self = $self->SUPER::new (@args);
# $ENV{HOME} is usually not set on Windows. The default Term::Cap path
# may not work on Solaris.
@@ -59,17 +54,37 @@ sub new {
$ospeed = $termios->getospeed || 9600;
}
- # Fall back on the ANSI escape sequences if Term::Cap doesn't work.
- eval { $term = Tgetent Term::Cap { TERM => undef, OSPEED => $ospeed } };
- $$self{BOLD} = $$term{_md} || "\e[1m";
- $$self{UNDL} = $$term{_us} || "\e[4m";
- $$self{NORM} = $$term{_me} || "\e[m";
-
- unless (defined $$self{width}) {
- $$self{opt_width} = $ENV{COLUMNS} || $$term{_co} || 80;
- $$self{opt_width} -= 2;
+ # Get data from Term::Cap if possible.
+ my ($bold, $undl, $norm, $width);
+ eval {
+ my $term = Tgetent Term::Cap { TERM => undef, OSPEED => $ospeed };
+ $bold = $term->Tputs('md');
+ $undl = $term->Tputs('us');
+ $norm = $term->Tputs('me');
+ if (defined $$term{_co}) {
+ $width = $$term{_co};
+ $width =~ s/^\#//;
+ }
+ };
+
+ # Figure out the terminal width before calling the Pod::Text constructor,
+ # since it will otherwise force 76 characters. Pod::Text::Termcap has
+ # historically used 2 characters less than the width of the screen, while
+ # the other Pod::Text classes have used 76. This is weirdly inconsistent,
+ # but there's probably no good reason to change it now.
+ unless (defined $args{width}) {
+ $args{width} = $ENV{COLUMNS} || $width || 80;
+ $args{width} -= 2;
}
+ # Initialize Pod::Text.
+ $self = $self->SUPER::new (%args);
+
+ # Fall back on the ANSI escape sequences if Term::Cap doesn't work.
+ $$self{BOLD} = $bold || "\e[1m";
+ $$self{UNDL} = $undl || "\e[4m";
+ $$self{NORM} = $norm || "\e[m";
+
return $self;
}
@@ -91,6 +106,23 @@ sub cmd_head2 {
sub cmd_b { my $self = shift; return "$$self{BOLD}$_[1]$$self{NORM}" }
sub cmd_i { my $self = shift; return "$$self{UNDL}$_[1]$$self{NORM}" }
+# Analyze a single line and return any formatting codes in effect at the end
+# of that line.
+sub end_format {
+ my ($self, $line) = @_;
+ my $pattern = "(\Q$$self{BOLD}\E|\Q$$self{UNDL}\E|\Q$$self{NORM}\E)";
+ my $current;
+ while ($line =~ /$pattern/g) {
+ my $code = $1;
+ if ($code eq $$self{NORM}) {
+ undef $current;
+ } else {
+ $current .= $code;
+ }
+ }
+ return $current;
+}
+
# Output any included code in bold.
sub output_code {
my ($self, $code) = @_;
@@ -115,22 +147,48 @@ sub wrap {
my $spaces = ' ' x $$self{MARGIN};
my $width = $$self{opt_width} - $$self{MARGIN};
- # $codes matches a single special sequence. $char matches any number of
+ # $code matches a single special sequence. $char matches any number of
# special sequences preceding a single character other than a newline.
- # We have to do $shortchar and $longchar in variables because the
+ # $shortchar matches some sequence of $char ending in codes followed by
+ # whitespace or the end of the string. $longchar matches exactly $width
+ # $chars, used when we have to truncate and hard wrap.
+ #
+ # $shortchar and $longchar are created in a slightly odd way because the
# construct ${char}{0,$width} didn't do the right thing until Perl 5.8.x.
- my $codes = "(?:\Q$$self{BOLD}\E|\Q$$self{UNDL}\E|\Q$$self{NORM}\E)";
- my $char = "(?:$codes*[^\\n])";
- my $shortchar = $char . "{0,$width}";
- my $longchar = $char . "{$width}";
+ my $code = "(?:\Q$$self{BOLD}\E|\Q$$self{UNDL}\E|\Q$$self{NORM}\E)";
+ my $char = "(?>$code*[^\\n])";
+ my $shortchar = '^(' . $char . "{0,$width}(?>$code*)" . ')(?:\s+|\z)';
+ my $longchar = '^(' . $char . "{$width})";
while (length > $width) {
- if (s/^($shortchar)\s+// || s/^($longchar)//) {
+ if (s/$shortchar// || s/$longchar//) {
$output .= $spaces . $1 . "\n";
} else {
last;
}
}
$output .= $spaces . $_;
+
+ # less -R always resets terminal attributes at the end of each line, so we
+ # need to clear attributes at the end of lines and then set them again at
+ # the start of the next line. This requires a second pass through the
+ # wrapped string, accumulating any attributes we see, remembering them,
+ # and then inserting the appropriate sequences at the newline.
+ if ($output =~ /\n/) {
+ my @lines = split (/\n/, $output);
+ my $start_format;
+ for my $line (@lines) {
+ if ($start_format && $line =~ /\S/) {
+ $line =~ s/^(\s*)(\S)/$1$start_format$2/;
+ }
+ $start_format = $self->end_format ($line);
+ if ($start_format) {
+ $line .= $$self{NORM};
+ }
+ }
+ $output = join ("\n", @lines);
+ }
+
+ # Fix up trailing whitespace and return the results.
$output =~ s/\s+$/\n\n/;
return $output;
}
@@ -187,24 +245,28 @@ regard as ANSI X3.64 and ISO 6429, the escape codes also used by DEC VT100
terminals) if the bold, underline, and reset codes aren't set in the
termcap information.
-=head1 SEE ALSO
-
-L<Pod::Text>, L<Pod::Simple>, L<Term::Cap>
-
-The current version of this module is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
-Perl core distribution as of 5.6.0.
-
=head1 AUTHOR
Russ Allbery <rra@cpan.org>.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2001, 2002, 2004, 2006, 2008, 2009, 2014, 2015 Russ Allbery
+Copyright 1999, 2001-2002, 2004, 2006, 2008-2009, 2014-2015, 2018 Russ Allbery
<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
+=head1 SEE ALSO
+
+L<Pod::Text>, L<Pod::Simple>, L<Term::Cap>
+
+The current version of this module is always available from its web site at
+L<https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
+Perl core distribution as of 5.6.0.
+
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
index 3f19b791d5..bc455d8829 100644
--- a/cpan/podlators/scripts/pod2man.PL
+++ b/cpan/podlators/scripts/pod2man.PL
@@ -44,13 +44,11 @@ PREAMBLE
# In the following, Perl variables are not expanded during extraction.
print {$out} <<'SCRIPT_BODY' or die "Cannot write to $file: $!\n";
-# pod2man -- Convert POD data to formatted *roff input.
+# Convert POD data to formatted *roff input.
#
-# Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014, 2015,
-# 2016, 2017 Russ Allbery <rra@cpan.org>
+# The driver script for Pod::Man.
#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
@@ -128,9 +126,9 @@ exit $status;
__END__
=for stopwords
-en em --stderr stderr --utf8 UTF-8 overdo markup MT-LEVEL Allbery Solaris
-URL troff troff-specific formatters uppercased Christiansen --nourls UTC
-prepend lquote rquote
+en em --stderr stderr --utf8 UTF-8 overdo markup MT-LEVEL Allbery Solaris URL
+troff troff-specific formatters uppercased Christiansen --nourls UTC prepend
+lquote rquote
=head1 NAME
@@ -412,18 +410,6 @@ L<Pod::Man> for more details.
Lots of this documentation is duplicated from L<Pod::Man>.
-=head1 SEE ALSO
-
-L<Pod::Man>, L<Pod::Simple>, L<man(1)>, L<nroff(1)>, L<perlpod(1)>,
-L<podchecker(1)>, L<perlpodstyle(1)>, L<troff(1)>, L<man(7)>
-
-The man page documenting the an macro set may be L<man(5)> instead of
-L<man(7)> on your system.
-
-The current version of this script is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
-Perl core distribution as of 5.6.0.
-
=head1 AUTHOR
Russ Allbery <rra@cpan.org>, based I<very> heavily on the original
@@ -431,12 +417,24 @@ B<pod2man> by Larry Wall and Tom Christiansen.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014,
-2015, 2016, 2017 Russ Allbery <rra@cpan.org>
+Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2018 Russ Allbery
+<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
+=head1 SEE ALSO
+
+L<Pod::Man>, L<Pod::Simple>, L<man(1)>, L<nroff(1)>, L<perlpod(1)>,
+L<podchecker(1)>, L<perlpodstyle(1)>, L<troff(1)>, L<man(7)>
+
+The man page documenting the an macro set may be L<man(5)> instead of
+L<man(7)> on your system.
+
+The current version of this script is always available from its web site at
+L<https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
+Perl core distribution as of 5.6.0.
+
=cut
SCRIPT_BODY
@@ -446,3 +444,7 @@ chmod(0755, $file) or die "Cannot reset permissions for $file: $!\n";
if ($Config{'eunicefix'} ne q{:}) {
exec("$Config{'eunicefix'} $file");
}
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/scripts/pod2text.PL b/cpan/podlators/scripts/pod2text.PL
index d1a146e8f0..bae8574152 100644
--- a/cpan/podlators/scripts/pod2text.PL
+++ b/cpan/podlators/scripts/pod2text.PL
@@ -44,16 +44,12 @@ PREAMBLE
# In the following, Perl variables are not expanded during extraction.
print {$out} <<'SCRIPT_BODY' or die "Cannot write to $file: $!\n";
-# pod2text -- Convert POD data to formatted ASCII text.
-#
-# Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014, 2015,
-# 2016, 2017 Russ Allbery <rra@cpan.org>
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# Convert POD data to formatted ASCII text.
#
# The driver script for Pod::Text, Pod::Text::Termcap, and Pod::Text::Color,
# invoked by perldoc -t among other things.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
@@ -82,10 +78,8 @@ for (my $i = 0; $i < @ARGV; $i++) {
my $stdin;
@ARGV = map { $_ eq '-' && !$stdin++ ? ('--', $_) : $_ } @ARGV;
-# Parse our options. Use the same names as Pod::Text for simplicity, and
-# default to sentence boundaries turned off for compatibility.
+# Parse our options. Use the same names as Pod::Text for simplicity.
my %options;
-$options{sentence} = 0;
Getopt::Long::config ('bundling');
GetOptions (\%options, 'alt|a', 'code', 'color|c', 'errors=s', 'help|h',
'indent|i=i', 'loose|l', 'margin|left-margin|m=i', 'nourls',
@@ -346,27 +340,27 @@ current terminal device.
=back
-=head1 SEE ALSO
-
-L<Pod::Text>, L<Pod::Text::Color>, L<Pod::Text::Overstrike>,
-L<Pod::Text::Termcap>, L<Pod::Simple>, L<perlpod(1)>
-
-The current version of this script is always available from its web site at
-L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
-Perl core distribution as of 5.6.0.
-
=head1 AUTHOR
Russ Allbery <rra@cpan.org>.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014, 2015,
-2016, 2017 Russ Allbery <rra@cpan.org>
+Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2018 Russ Allbery
+<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
+=head1 SEE ALSO
+
+L<Pod::Text>, L<Pod::Text::Color>, L<Pod::Text::Overstrike>,
+L<Pod::Text::Termcap>, L<Pod::Simple>, L<perlpod(1)>
+
+The current version of this script is always available from its web site at
+L<https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
+Perl core distribution as of 5.6.0.
+
=cut
SCRIPT_BODY
@@ -376,3 +370,7 @@ chmod(0755, $file) or die "Cannot reset permissions for $file: $!\n";
if ($Config{'eunicefix'} ne ':') {
exec("$Config{'eunicefix'} $file");
}
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/t/data/basic.cap b/cpan/podlators/t/data/basic.cap
index d580ed89dc..3d1451de19 100644
--- a/cpan/podlators/t/data/basic.cap
+++ b/cpan/podlators/t/data/basic.cap
@@ -264,3 +264,13 @@
CONCLUSION
That's all, folks!
+COPYRIGHT AND LICENSE
+ Copyright 2001, 2004, 2016, 2018 Russ Allbery <rra@cpan.org>
+
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided the copyright notice and
+ this notice are preserved. This file is offered as-is, without any
+ warranty.
+
+ SPDX-License-Identifier: FSFAP
+
diff --git a/cpan/podlators/t/data/basic.clr b/cpan/podlators/t/data/basic.clr
index f9591c87d6..db17142eb3 100644
--- a/cpan/podlators/t/data/basic.clr
+++ b/cpan/podlators/t/data/basic.clr
@@ -265,3 +265,13 @@
CONCLUSION
That's all, folks!
+COPYRIGHT AND LICENSE
+ Copyright 2001, 2004, 2016, 2018 Russ Allbery <rra@cpan.org>
+
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided the copyright notice
+ and this notice are preserved. This file is offered as-is, without any
+ warranty.
+
+ SPDX-License-Identifier: FSFAP
+
diff --git a/cpan/podlators/t/data/basic.man b/cpan/podlators/t/data/basic.man
index 871bd923fd..e2fe97805e 100644
--- a/cpan/podlators/t/data/basic.man
+++ b/cpan/podlators/t/data/basic.man
@@ -317,3 +317,13 @@ up.)
.SH "CONCLUSION"
.IX Header "CONCLUSION"
That's all, folks!
+.SH "COPYRIGHT AND LICENSE"
+.IX Header "COPYRIGHT AND LICENSE"
+Copyright 2001, 2004, 2016, 2018 Russ Allbery <rra@cpan.org>
+.PP
+Copying and distribution of this file, with or without modification, are
+permitted in any medium without royalty provided the copyright notice and
+this notice are preserved. This file is offered as-is, without any
+warranty.
+.PP
+SPDX-License-Identifier: \s-1FSFAP\s0
diff --git a/cpan/podlators/t/data/basic.ovr b/cpan/podlators/t/data/basic.ovr
index 14a116946a..c55ab07815 100644
--- a/cpan/podlators/t/data/basic.ovr
+++ b/cpan/podlators/t/data/basic.ovr
@@ -265,3 +265,13 @@ VVEERRBBAATTIIMM
CCOONNCCLLUUSSIIOONN
That's all, folks!
+CCOOPPYYRRIIGGHHTT  AANNDD  LLIICCEENNSSEE
+ Copyright 2001, 2004, 2016, 2018 Russ Allbery <rra@cpan.org>
+
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided the copyright notice
+ and this notice are preserved. This file is offered as-is, without any
+ warranty.
+
+ SPDX-License-Identifier: FSFAP
+
diff --git a/cpan/podlators/t/data/basic.pod b/cpan/podlators/t/data/basic.pod
index 3c784e6fcb..7101e6436c 100644
--- a/cpan/podlators/t/data/basic.pod
+++ b/cpan/podlators/t/data/basic.pod
@@ -378,4 +378,15 @@ up.)
That's all, folks!
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2001, 2004, 2016, 2018 Russ Allbery <rra@cpan.org>
+
+Copying and distribution of this file, with or without modification, are
+permitted in any medium without royalty provided the copyright notice and
+this notice are preserved. This file is offered as-is, without any
+warranty.
+
+SPDX-License-Identifier: FSFAP
+
=cut
diff --git a/cpan/podlators/t/data/basic.txt b/cpan/podlators/t/data/basic.txt
index f0f8ba216d..6228b24ddf 100644
--- a/cpan/podlators/t/data/basic.txt
+++ b/cpan/podlators/t/data/basic.txt
@@ -265,3 +265,13 @@ VERBATIM
CONCLUSION
That's all, folks!
+COPYRIGHT AND LICENSE
+ Copyright 2001, 2004, 2016, 2018 Russ Allbery <rra@cpan.org>
+
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided the copyright notice
+ and this notice are preserved. This file is offered as-is, without any
+ warranty.
+
+ SPDX-License-Identifier: FSFAP
+
diff --git a/cpan/podlators/t/data/snippets/README b/cpan/podlators/t/data/snippets/README
index 0e7252daa4..342959585b 100644
--- a/cpan/podlators/t/data/snippets/README
+++ b/cpan/podlators/t/data/snippets/README
@@ -37,9 +37,11 @@ man (Pod::Man), text (Pod::Text), color (Pod::Text::Color), overstrike
-----
-Copyright 2015 Russ Allbery <rra@cpan.org>
+Copyright 2015, 2018 Russ Allbery <rra@cpan.org>
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice and
this notice are preserved. This file is offered as-is, without any
warranty.
+
+SPDX-License-Identifier: FSFAP
diff --git a/cpan/podlators/t/data/snippets/color/escape-wrapping b/cpan/podlators/t/data/snippets/color/escape-wrapping
new file mode 100644
index 0000000000..b2145c84c0
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/color/escape-wrapping
@@ -0,0 +1,19 @@
+[name]
+Wrapping in the middle of formatting
+
+[options]
+width 60
+
+[input]
+=over 4
+
+=item B<autosetup status> [B<-t>] {B<-a>|[B<-e>|B<-f>|B<-u>] I<hostname> ...}
+
+=item B<autosetup install -p standard_test_only_trigger host1 host2 host3>
+
+=back
+
+[output]
+ autosetup status [-t] {-a|[-e|-f|-u] hostname ...}
+ autosetup install -p standard_test_only_trigger host1
+ host2 host3
diff --git a/cpan/podlators/t/data/snippets/color/tag-width b/cpan/podlators/t/data/snippets/color/tag-width
new file mode 100644
index 0000000000..4a71816c8e
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/color/tag-width
@@ -0,0 +1,35 @@
+[name]
+Tag width with formatting
+
+[input]
+=head1 TAG WIDTH
+
+=over 10
+
+=item 12345678
+
+A
+
+=item B<12345678>
+
+B
+
+=item 1Z<>
+
+C
+
+=item B<1>
+
+D
+
+=back
+
+[output]
+TAG WIDTH
+ 12345678 A
+
+ 12345678 B
+
+ 1 C
+
+ 1 D
diff --git a/cpan/podlators/t/data/snippets/color/tag-wrapping b/cpan/podlators/t/data/snippets/color/tag-wrapping
new file mode 100644
index 0000000000..a7975da0d8
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/color/tag-wrapping
@@ -0,0 +1,19 @@
+[name]
+Tag width with formatting
+
+[input]
+=head1 TAG WRAPPING
+
+Per discussion in #124447, this was wrapping before the ellipses.
+
+=over 4
+
+=item B<autosetup print analysis> [B<-e>|B<-f>|B<-u>] I<hostname> ...
+
+=back
+
+[output]
+TAG WRAPPING
+ Per discussion in #124447, this was wrapping before the ellipses.
+
+ autosetup print analysis [-e|-f|-u] hostname ...
diff --git a/cpan/podlators/t/data/snippets/color/width b/cpan/podlators/t/data/snippets/color/width
new file mode 100644
index 0000000000..6e23bf1a09
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/color/width
@@ -0,0 +1,22 @@
+[name]
+Explicit width setting
+
+[options]
+width 40
+
+[input]
+=head1 WIDTH
+
+This is a long bit of text that would normally wrap at 78 characters using
+the default settings, but will be wrapped at 40 characters due to the
+option set.
+
+=cut
+
+[output]
+WIDTH
+ This is a long bit of text that
+ would normally wrap at 78 characters
+ using the default settings, but will
+ be wrapped at 40 characters due to
+ the option set.
diff --git a/cpan/podlators/t/data/snippets/color/wrapping b/cpan/podlators/t/data/snippets/color/wrapping
new file mode 100644
index 0000000000..74254660b1
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/color/wrapping
@@ -0,0 +1,11 @@
+[name]
+Wrap with format codes
+
+[input]
+=head1 WRAPPING
+
+B<I<Do>> I<B<not>> B<I<include>> B<I<formatting codes when>> B<I<wrapping>>.
+
+[output]
+WRAPPING
+ Do not include formatting codes when wrapping.
diff --git a/cpan/podlators/t/data/snippets/man/error-none b/cpan/podlators/t/data/snippets/man/error-none
index 676fc401d5..0636c3c476 100644
--- a/cpan/podlators/t/data/snippets/man/error-none
+++ b/cpan/podlators/t/data/snippets/man/error-none
@@ -5,6 +5,8 @@ Suppress errors
errors none
[input]
+=cut
+
=over 4
=item Foo
diff --git a/cpan/podlators/t/data/snippets/man/uppercase-license b/cpan/podlators/t/data/snippets/man/uppercase-license
index 4c02452f06..f49baa3318 100644
--- a/cpan/podlators/t/data/snippets/man/uppercase-license
+++ b/cpan/podlators/t/data/snippets/man/uppercase-license
@@ -4,6 +4,16 @@ Uppercase license text
[input]
=head1 Uppercase License
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
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.
@@ -12,9 +22,21 @@ 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.
+SPDX-License-Identifier: MIT
+
[output]
.SH "Uppercase License"
.IX Header "Uppercase License"
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the \*(L"Software\*(R"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+.PP
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+.PP
\&\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.
@@ -22,3 +44,5 @@ 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
+.PP
+SPDX-License-Identifier: \s-1MIT\s0
diff --git a/cpan/podlators/t/data/snippets/termcap/escape-wrapping b/cpan/podlators/t/data/snippets/termcap/escape-wrapping
new file mode 100644
index 0000000000..197d6e9886
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/termcap/escape-wrapping
@@ -0,0 +1,19 @@
+[name]
+Wrapping in the middle of formatting
+
+[options]
+width 60
+
+[input]
+=over 4
+
+=item B<autosetup status> [B<-t>] {B<-a>|[B<-e>|B<-f>|B<-u>] I<hostname> ...}
+
+=item B<autosetup install -p standard_test_only_trigger host1 host2 host3>
+
+=back
+
+[output]
+ autosetup status [-t] {-a|[-e|-f|-u] hostname ...}
+ autosetup install -p standard_test_only_trigger host1
+ host2 host3
diff --git a/cpan/podlators/t/data/snippets/termcap/tag-width b/cpan/podlators/t/data/snippets/termcap/tag-width
new file mode 100644
index 0000000000..3ab75006bc
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/termcap/tag-width
@@ -0,0 +1,35 @@
+[name]
+Tag width with formatting
+
+[input]
+=head1 TAG WIDTH
+
+=over 10
+
+=item 12345678
+
+A
+
+=item B<12345678>
+
+B
+
+=item 1Z<>
+
+C
+
+=item B<1>
+
+D
+
+=back
+
+[output]
+TAG WIDTH
+ 12345678 A
+
+ 12345678 B
+
+ 1 C
+
+ 1 D
diff --git a/cpan/podlators/t/data/snippets/termcap/tag-wrapping b/cpan/podlators/t/data/snippets/termcap/tag-wrapping
new file mode 100644
index 0000000000..32becfed55
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/termcap/tag-wrapping
@@ -0,0 +1,19 @@
+[name]
+Tag width with formatting
+
+[input]
+=head1 TAG WRAPPING
+
+Per discussion in #124447, this was wrapping before the ellipses.
+
+=over 4
+
+=item B<autosetup print analysis> [B<-e>|B<-f>|B<-u>] I<hostname> ...
+
+=back
+
+[output]
+TAG WRAPPING
+ Per discussion in #124447, this was wrapping before the ellipses.
+
+ autosetup print analysis [-e|-f|-u] hostname ...
diff --git a/cpan/podlators/t/data/snippets/termcap/width b/cpan/podlators/t/data/snippets/termcap/width
new file mode 100644
index 0000000000..abc4327f57
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/termcap/width
@@ -0,0 +1,23 @@
+[name]
+Explicit width setting
+
+[options]
+width 40
+
+[input]
+=head1 WIDTH
+
+This is a long bit of text that would normally wrap at 78 characters using
+the default settings, but will be wrapped at 40 characters due to the
+option set. (Regression test for #124447.)
+
+=cut
+
+[output]
+WIDTH
+ This is a long bit of text that
+ would normally wrap at 78 characters
+ using the default settings, but will
+ be wrapped at 40 characters due to
+ the option set. (Regression test for
+ #124447.)
diff --git a/cpan/podlators/t/data/snippets/termcap/wrapping b/cpan/podlators/t/data/snippets/termcap/wrapping
new file mode 100644
index 0000000000..19207616b6
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/termcap/wrapping
@@ -0,0 +1,11 @@
+[name]
+Wrap with format codes
+
+[input]
+=head1 WRAPPING
+
+B<I<Do>> I<B<not>> B<I<include>> B<I<formatting codes when>> B<I<wrapping>>.
+
+[output]
+WRAPPING
+ Do not include formatting codes when wrapping.
diff --git a/cpan/podlators/t/docs/pod-spelling.t b/cpan/podlators/t/docs/pod-spelling.t
index dc11b9cf92..94d75035bc 100644
--- a/cpan/podlators/t/docs/pod-spelling.t
+++ b/cpan/podlators/t/docs/pod-spelling.t
@@ -6,7 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2013, 2014
+# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,6 +26,8 @@
# 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.
+#
+# SPDX-License-Identifier: MIT
use 5.006;
use strict;
diff --git a/cpan/podlators/t/docs/pod.t b/cpan/podlators/t/docs/pod.t
index 2ef7bf07c7..5fcfcdf77c 100644
--- a/cpan/podlators/t/docs/pod.t
+++ b/cpan/podlators/t/docs/pod.t
@@ -6,7 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2012, 2013, 2014
+# Copyright 2012-2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,6 +26,8 @@
# 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.
+#
+# SPDX-License-Identifier: MIT
use 5.006;
use strict;
diff --git a/cpan/podlators/t/docs/spdx-license.t b/cpan/podlators/t/docs/spdx-license.t
new file mode 100644
index 0000000000..100adf11ee
--- /dev/null
+++ b/cpan/podlators/t/docs/spdx-license.t
@@ -0,0 +1,120 @@
+#!/usr/bin/perl
+#
+# Check source files for SPDX-License-Identifier fields.
+#
+# Examine all source files in a distribution to check that they contain an
+# SPDX-License-Identifier field. This does not check the syntax or whether
+# the identifiers are valid.
+#
+# The canonical version of this file is maintained in the rra-c-util package,
+# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
+#
+# Copyright 2018 Russ Allbery <eagle@eyrie.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# 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.
+#
+# SPDX-License-Identifier: MIT
+
+use 5.006;
+use strict;
+use warnings;
+
+use lib 't/lib';
+
+use File::Find qw(find);
+use Test::More;
+use Test::RRA qw(skip_unless_automated);
+
+# File name (the file without any directory component) and path patterns to
+# skip for this check.
+## no critic (RegularExpressions::ProhibitFixedStringMatches)
+my @IGNORE = (
+ qr{ \A Build ( [.] .* )? \z }ixms, # Generated file from Build.PL
+ qr{ \A LICENSE \z }xms, # Generated file, no license itself
+ qr{ \A (Changes|NEWS|THANKS) \z }xms, # Package license should be fine
+ qr{ \A TODO \z }xms, # Package license should be fine
+ qr{ \A MANIFEST ( [.] .* )? \z }xms, # Package license should be fine
+ qr{ \A Makefile \z }xms, # Generated file, no license itself
+ qr{ \A (MY)? META [.] .* }xms, # Generated file, no license itself
+ qr{ [.] output \z }xms, # Test data
+ qr{ pod2htm . [.] tmp \z }xms, # Windows pod2html output
+);
+my @IGNORE_PATHS = (
+ qr{ \A [.] / [.] git/ }xms, # Version control files
+ qr{ \A [.] /_build/ }xms, # Module::Build metadata
+ qr{ \A [.] /blib/ }xms, # Perl build system artifacts
+ qr{ \A [.] /cover_db/ }xms, # Artifacts from coverage testing
+ qr{ \A [.] /docs/metadata/ }xms, # Package license should be fine
+ qr{ \A [.] /README ( [.] .* )? \z }xms, # Package license should be fine
+ qr{ \A [.] /share/ }xms, # Package license should be fine
+ qr{ \A [.] /t/data .* /metadata/ }xms, # Test metadata
+ qr{ \A [.] /t/data .* /output/ }xms, # Test output
+);
+## use critic
+
+# Only run this test during automated testing, since failure doesn't indicate
+# any user-noticable flaw in the package itself.
+skip_unless_automated('SPDX identifier tests');
+
+# Check a single file for an occurrence of the string.
+#
+# $path - Path to the file
+#
+# Returns: undef
+sub check_file {
+ my $filename = $_;
+ my $path = $File::Find::name;
+
+ # Ignore files in the whitelist, binary files, and files under 1KB. The
+ # latter can be rolled up into the overall project license and the license
+ # notice may be a substantial portion of the file size.
+ for my $pattern (@IGNORE) {
+ return if $filename =~ $pattern;
+ }
+ for my $pattern (@IGNORE_PATHS) {
+ if ($path =~ $pattern) {
+ $File::Find::prune = 1;
+ return;
+ }
+ }
+ return if -d $filename;
+ return if !-T $filename;
+ return if -s $filename < 1024;
+
+ # Scan the file.
+ my ($saw_spdx, $skip_spdx);
+ open(my $file, '<', $filename) or BAIL_OUT("Cannot open $path");
+ while (defined(my $line = <$file>)) {
+ if ($line =~ m{ \b SPDX-License-Identifier: \s+ \S+ }xms) {
+ $saw_spdx = 1;
+ last;
+ }
+ if ($line =~ m{ no \s SPDX-License-Identifier \s registered }xms) {
+ $skip_spdx = 1;
+ last;
+ }
+ }
+ close($file) or BAIL_OUT("Cannot close $path");
+ ok($saw_spdx || $skip_spdx, $path);
+ return;
+}
+
+# Use File::Find to scan all files from the top of the directory.
+find(\&check_file, q{.});
+done_testing();
diff --git a/cpan/podlators/t/docs/synopsis.t b/cpan/podlators/t/docs/synopsis.t
index 384e407b7e..43a8354ba4 100644
--- a/cpan/podlators/t/docs/synopsis.t
+++ b/cpan/podlators/t/docs/synopsis.t
@@ -6,7 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2013, 2014
+# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,6 +26,8 @@
# 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.
+#
+# SPDX-License-Identifier: MIT
use 5.006;
use strict;
diff --git a/cpan/podlators/t/docs/urls.t b/cpan/podlators/t/docs/urls.t
new file mode 100644
index 0000000000..a654c5453c
--- /dev/null
+++ b/cpan/podlators/t/docs/urls.t
@@ -0,0 +1,95 @@
+#!/usr/bin/perl
+#
+# Check URLs in source files.
+#
+# Examine all source files in a distribution for bad URL patterns and report
+# on files that fail this check. Currently, this just checks that all the
+# links to www.eyrie.org are https.
+#
+# The canonical version of this file is maintained in the rra-c-util package,
+# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
+#
+# Copyright 2016 Russ Allbery <eagle@eyrie.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# 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.
+#
+# SPDX-License-Identifier: MIT
+
+use 5.006;
+use strict;
+use warnings;
+
+use lib 't/lib';
+
+use File::Find qw(find);
+use Test::More;
+use Test::RRA qw(skip_unless_automated);
+
+# Bad patterns to search for.
+my @BAD_REGEXES = (qr{ http:// \S+ [.]eyrie[.]org }xms);
+my @BAD_STRINGS = qw(rra@stanford.edu);
+
+# File or directory names to always skip.
+my %SKIP = map { $_ => 1 } qw(.git _build blib cover_db);
+
+# Only run this test during automated testing, since failure doesn't indicate
+# any user-noticable flaw in the package itself.
+skip_unless_automated('Documentation URL tests');
+
+# Scan files for bad URL patterns. This is meant to be run as the wanted
+# function from File::Find.
+sub check_file {
+ my $filename = $_;
+
+ # Ignore this check itself (or the non-Perl version of it). Ignore any
+ # directories or binary files. Ignore and prune any skipped files.
+ if ($SKIP{$filename}) {
+ $File::Find::prune = 1;
+ return;
+ }
+ return if -d $filename;
+ return if !-T $filename;
+ return if ($filename eq 'urls.t' || $filename eq 'urls-t');
+
+ # Scan the file.
+ open(my $fh, '<', $filename) or BAIL_OUT("Cannot open $File::Find::name");
+ while (defined(my $line = <$fh>)) {
+ for my $regex (@BAD_REGEXES) {
+ if ($line =~ $regex) {
+ ok(0, "$File::Find::name contains $regex");
+ close($fh) or BAIL_OUT("Cannot close $File::Find::name");
+ return;
+ }
+ }
+ for my $string (@BAD_STRINGS) {
+ if (index($line, $string) != -1) {
+ ok(0, "$File::Find::name contains $string");
+ close($fh) or BAIL_OUT("Cannot close $File::Find::name");
+ return;
+ }
+ }
+ }
+ close($fh) or BAIL_OUT("Cannot close $File::Find::name");
+ ok(1, $File::Find::name);
+ return;
+}
+
+# Use File::Find to scan all files from the top of the directory.
+find(\&check_file, q{.});
+done_testing();
diff --git a/cpan/podlators/t/general/basic.t b/cpan/podlators/t/general/basic.t
index 9b676cc8c5..717e3762df 100644
--- a/cpan/podlators/t/general/basic.t
+++ b/cpan/podlators/t/general/basic.t
@@ -12,11 +12,13 @@
# the machinery to run small POD snippets through the specific formatter being
# tested should probably be used instead.
#
-# Copyright 2001, 2002, 2004, 2006, 2009, 2012, 2014, 2015
+# Copyright 2001-2002, 2004, 2006, 2009, 2012, 2014-2015, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
@@ -59,13 +61,10 @@ my %OUTPUT = (
'Pod::Text::Termcap' => File::Spec->catfile('t', 'data', 'basic.cap'),
);
-# Options to pass to all formatting modules. Match the pod2text default.
-my @OPTIONS = (sentence => 0);
-
# Walk through teach of the modules and format the sample file, checking to
# ensure the results match the pre-generated file.
for my $module (sort keys %OUTPUT) {
- my $parser = $module->new(@OPTIONS);
+ my $parser = $module->new();
isa_ok($parser, $module, 'parser object');
# Run the formatting module. Store the output into a Perl variable
diff --git a/cpan/podlators/t/general/filehandle.t b/cpan/podlators/t/general/filehandle.t
index cd6a229c24..42601a0587 100644
--- a/cpan/podlators/t/general/filehandle.t
+++ b/cpan/podlators/t/general/filehandle.t
@@ -6,10 +6,12 @@
# Pod::Man and Pod::Text had to implement it directly. Test to be sure it's
# working properly.
#
-# Copyright 2006, 2009, 2012, 2014, 2015, 2016 Russ Allbery <rra@cpan.org>
+# Copyright 2006, 2009, 2012, 2014-2016, 2018 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/general/pod-parser.t b/cpan/podlators/t/general/pod-parser.t
index 95f399fbdc..9c51aff87a 100644
--- a/cpan/podlators/t/general/pod-parser.t
+++ b/cpan/podlators/t/general/pod-parser.t
@@ -2,10 +2,12 @@
#
# Tests for backward compatibility with Pod::Parser.
#
-# Copyright 2006, 2008, 2009, 2012, 2015 by Russ Allbery <rra@cpan.org>
+# Copyright 2006, 2008-2009, 2012, 2015, 2018 by Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/lib/Test/Podlators.pm b/cpan/podlators/t/lib/Test/Podlators.pm
index 63795b1ef0..3ae940924e 100644
--- a/cpan/podlators/t/lib/Test/Podlators.pm
+++ b/cpan/podlators/t/lib/Test/Podlators.pm
@@ -4,10 +4,7 @@
# suite. It provides some supporting functions to make it easier to write
# tests.
#
-# Copyright 2015, 2016 Russ Allbery <rra@cpan.org>
-#
-# This program is free software; you may redistribute it and/or modify it
-# under the same terms as Perl itself.
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
package Test::Podlators;
@@ -276,6 +273,9 @@ sub test_snippet {
$got =~ s{ \A .* \n [.]nh \n }{}xms;
}
+ # Strip any trailing blank lines (Pod::Text likes to add them).
+ $got =~ s{ \n\s+ \z }{\n}xms;
+
# Check the output, errors, and any exception.
is($got, $data_ref->{output}, "$data_ref->{name}: output");
if ($data_ref->{errors}) {
@@ -509,9 +509,13 @@ Russ Allbery <rra@cpan.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2015, 2016 Russ Allbery <rra@cpan.org>
+Copyright 2015, 2016, 2018 Russ Allbery <rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/t/lib/Test/RRA.pm b/cpan/podlators/t/lib/Test/RRA.pm
index bbdb2b0213..cbfdc42603 100644
--- a/cpan/podlators/t/lib/Test/RRA.pm
+++ b/cpan/podlators/t/lib/Test/RRA.pm
@@ -5,6 +5,8 @@
# by both C packages with Automake and by stand-alone Perl modules. See
# Test::RRA::Automake for additional functions specifically for C Automake
# distributions.
+#
+# SPDX-License-Identifier: MIT
package Test::RRA;
@@ -34,7 +36,7 @@ BEGIN {
# This version should match the corresponding rra-c-util release, but with
# two digits for the minor version, including a leading zero if necessary,
# so that it will sort properly.
- $VERSION = '6.03';
+ $VERSION = '7.01';
}
# Compare a string to the contents of a file, similar to the standard is()
@@ -277,3 +279,7 @@ by the L<Lancaster
Consensus|https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md>.
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/t/lib/Test/RRA/Config.pm b/cpan/podlators/t/lib/Test/RRA/Config.pm
index 7390ffa734..b2f94466dd 100644
--- a/cpan/podlators/t/lib/Test/RRA/Config.pm
+++ b/cpan/podlators/t/lib/Test/RRA/Config.pm
@@ -4,6 +4,8 @@
# configuration file to store some package-specific data. This module loads
# that configuration and provides the namespace for the configuration
# settings.
+#
+# SPDX-License-Identifier: MIT
package Test::RRA::Config;
@@ -34,7 +36,7 @@ BEGIN {
# This version should match the corresponding rra-c-util release, but with
# two digits for the minor version, including a leading zero if necessary,
# so that it will sort properly.
- $VERSION = '6.03';
+ $VERSION = '7.01';
}
# If C_TAP_BUILD or C_TAP_SOURCE are set in the environment, look for
@@ -220,3 +222,7 @@ The C TAP Harness test driver and libraries for TAP-based C testing are
available from L<https://www.eyrie.org/~eagle/software/c-tap-harness/>.
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm b/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
index c4e82bce73..3b3d6742df 100644
--- a/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
+++ b/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
@@ -3,6 +3,8 @@
# This module contains the common code for testing and updating Perl module
# versions for consistency within a Perl module distribution and within a
# larger package that contains both Perl modules and other code.
+#
+# SPDX-License-Identifier: MIT
package Test::RRA::ModuleVersion;
@@ -31,7 +33,7 @@ BEGIN {
# This version should match the corresponding rra-c-util release, but with
# two digits for the minor version, including a leading zero if necessary,
# so that it will sort properly.
- $VERSION = '6.03';
+ $VERSION = '7.01';
}
# A regular expression matching the version string for a module using the
@@ -293,3 +295,7 @@ This module is maintained in the rra-c-util package. The current version
is available from L<https://www.eyrie.org/~eagle/software/rra-c-util/>.
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/t/man/devise-date.t b/cpan/podlators/t/man/devise-date.t
index 642d08cc4f..129721323c 100644
--- a/cpan/podlators/t/man/devise-date.t
+++ b/cpan/podlators/t/man/devise-date.t
@@ -5,10 +5,12 @@
# that it's identical. It also tests special handling of the POD_MAN_DATE
# environment variable.
#
-# Copyright 2009, 2014, 2015 Russ Allbery <rra@cpan.org>
+# Copyright 2009, 2014-2015, 2018 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/man/devise-title.t b/cpan/podlators/t/man/devise-title.t
index 45f3fca3a5..a7e5e7b89d 100644
--- a/cpan/podlators/t/man/devise-title.t
+++ b/cpan/podlators/t/man/devise-title.t
@@ -3,10 +3,12 @@
# Tests for the automatic determination of the manual page title if not
# specified via options to pod2man or the Pod::Man constructor.
#
-# Copyright 2015, 2016 Russ Allbery <rra@cpan.org>
+# Copyright 2015-2016, 2018 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/man/empty.t b/cpan/podlators/t/man/empty.t
index 3b70f82662..4924fc8466 100644
--- a/cpan/podlators/t/man/empty.t
+++ b/cpan/podlators/t/man/empty.t
@@ -2,10 +2,12 @@
#
# Test Pod::Man with a document that produces only errors.
#
-# Copyright 2013, 2016 Russ Allbery <rra@cpan.org>
+# Copyright 2013, 2016, 2018 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/man/heading.t b/cpan/podlators/t/man/heading.t
index 323fd62abf..9691446b6f 100644
--- a/cpan/podlators/t/man/heading.t
+++ b/cpan/podlators/t/man/heading.t
@@ -2,11 +2,13 @@
#
# Additional tests for Pod::Man heading generation.
#
-# Copyright 2002, 2004, 2006, 2008, 2009, 2012, 2015
+# Copyright 2002, 2004, 2006, 2008-2009, 2012, 2015, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/man/no-encode.t b/cpan/podlators/t/man/no-encode.t
index bdd4e683b1..15522a5d96 100644
--- a/cpan/podlators/t/man/no-encode.t
+++ b/cpan/podlators/t/man/no-encode.t
@@ -3,10 +3,12 @@
# Test for graceful degradation to non-utf8 output without Encode module.
#
# Copyright 2016 Niko Tyni <ntyni@iki.fi>
-# Copyright 2016 Russ Allbery <rra@cpan.org>
+# Copyright 2016, 2018 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/man/snippets.t b/cpan/podlators/t/man/snippets.t
index 4fa197a7aa..159887199a 100644
--- a/cpan/podlators/t/man/snippets.t
+++ b/cpan/podlators/t/man/snippets.t
@@ -2,11 +2,13 @@
#
# Test Pod::Man behavior with various snippets.
#
-# Copyright 2002, 2004, 2006, 2008, 2009, 2012, 2013, 2015, 2016
+# Copyright 2002, 2004, 2006, 2008-2009, 2012-2013, 2015-2016, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/man/utf8-io.t b/cpan/podlators/t/man/utf8-io.t
index 858f8f7e0a..d1c950076b 100644
--- a/cpan/podlators/t/man/utf8-io.t
+++ b/cpan/podlators/t/man/utf8-io.t
@@ -2,11 +2,13 @@
#
# Test Pod::Man UTF-8 handling, with and without PerlIO.
#
-# Copyright 2002, 2004, 2006, 2008, 2009, 2010, 2012, 2014, 2015
+# Copyright 2002, 2004, 2006, 2008-2010, 2012, 2014-2015, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
diff --git a/cpan/podlators/t/parselink/basic.t b/cpan/podlators/t/parselink/basic.t
index d06a3b5ea1..48fbb37f13 100644
--- a/cpan/podlators/t/parselink/basic.t
+++ b/cpan/podlators/t/parselink/basic.t
@@ -2,10 +2,12 @@
#
# parselink.t -- Tests for Pod::ParseLink.
#
-# Copyright 2001, 2009 by Russ Allbery <rra@cpan.org>
+# Copyright 2001, 2009, 2018 by Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
# The format of each entry in this array is the L<> text followed by the
# five-element parse returned by parselink.
diff --git a/cpan/podlators/t/style/minimum-version.t b/cpan/podlators/t/style/minimum-version.t
index c7f06898b2..7698c2babf 100644
--- a/cpan/podlators/t/style/minimum-version.t
+++ b/cpan/podlators/t/style/minimum-version.t
@@ -6,7 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2013, 2014
+# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,6 +26,8 @@
# 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.
+#
+# SPDX-License-Identifier: MIT
use 5.006;
use strict;
diff --git a/cpan/podlators/t/style/module-version.t b/cpan/podlators/t/style/module-version.t
index 021095ded2..80368cb02e 100644
--- a/cpan/podlators/t/style/module-version.t
+++ b/cpan/podlators/t/style/module-version.t
@@ -8,6 +8,8 @@
#
# When given the --update option, instead fixes all of the Perl modules found
# to have the correct version.
+#
+# SPDX-License-Identifier: MIT
use 5.006;
use strict;
@@ -118,9 +120,9 @@ Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2014, 2015, 2016 Russ Allbery <eagle@eyrie.org>
+Copyright 2014-2016 Russ Allbery <eagle@eyrie.org>
-Copyright 2013, 2014 The Board of Trustees of the Leland Stanford Junior
+Copyright 2013-2014 The Board of Trustees of the Leland Stanford Junior
University
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -147,3 +149,7 @@ This module is maintained in the rra-c-util package. The current version
is available from L<https://www.eyrie.org/~eagle/software/rra-c-util/>.
=cut
+
+# Local Variables:
+# copyright-at-end-flag: t
+# End:
diff --git a/cpan/podlators/t/style/strict.t b/cpan/podlators/t/style/strict.t
index 5f667b94a1..a3d2a3e942 100644
--- a/cpan/podlators/t/style/strict.t
+++ b/cpan/podlators/t/style/strict.t
@@ -7,7 +7,7 @@
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2016 Russ Allbery <eagle@eyrie.org>
-# Copyright 2013, 2014
+# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -27,6 +27,8 @@
# 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.
+#
+# SPDX-License-Identifier: MIT
use 5.006;
use strict;
diff --git a/cpan/podlators/t/text/basic.t b/cpan/podlators/t/text/basic.t
index 1d274c3e5c..024cc0e0e7 100644
--- a/cpan/podlators/t/text/basic.t
+++ b/cpan/podlators/t/text/basic.t
@@ -1,12 +1,14 @@
#!/usr/bin/perl -w
#
-# text.t -- Additional specialized tests for Pod::Text.
+# Additional specialized tests for Pod::Text.
#
-# Copyright 2002, 2004, 2006, 2007, 2008, 2009, 2012
+# Copyright 2002, 2004, 2006-2009, 2012, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
BEGIN {
chdir 't' if -d 't';
diff --git a/cpan/podlators/t/text/color.t b/cpan/podlators/t/text/color.t
index c2e13335ad..b7edd48a27 100644
--- a/cpan/podlators/t/text/color.t
+++ b/cpan/podlators/t/text/color.t
@@ -1,114 +1,31 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
-# color.t -- Additional specialized tests for Pod::Text::Color.
+# Test Pod::Text::Color behavior with various snippets.
#
-# Copyright 2002, 2004, 2006, 2009, 2012, 2013
+# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018
# Russ Allbery <rra@cpan.org>
#
# 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';
- }
- unshift (@INC, '../blib/lib');
- $| = 1;
-}
-
+use 5.006;
use strict;
+use warnings;
-use Test::More;
+use lib 't/lib';
-# Skip this test if Term::ANSIColor isn't available.
-eval { require Term::ANSIColor };
-if ($@) {
- plan skip_all => 'Term::ANSIColor required for Pod::Text::Color';
-} else {
- plan tests => 4;
-}
-require_ok ('Pod::Text::Color');
+use Test::More tests => 11;
+use Test::Podlators qw(test_snippet);
-# Load tests from the data section below, write the POD to a temporary file,
-# convert it, and compare to the expected output.
-my $parser = Pod::Text::Color->new;
-isa_ok ($parser, 'Pod::Text::Color', 'Parser object');
-my $n = 1;
-while (<DATA>) {
- next until $_ eq "###\n";
- open (TMP, "> tmp$$.pod") or die "Cannot create tmp$$.pod: $!\n";
- while (<DATA>) {
- last if $_ eq "###\n";
- print TMP $_;
- }
- close TMP;
- 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";
- my $output;
- {
- local $/;
- $output = <TMP>;
- }
- close TMP;
- 1 while unlink ("tmp$$.pod", "out$$.tmp");
- my $expected = '';
- while (<DATA>) {
- last if $_ eq "###\n";
- $expected .= $_;
- }
- is ($output, $expected, "Output correct for test $n");
- $n++;
+# Load the module.
+BEGIN {
+ use_ok('Pod::Text::Color');
}
-# Below the marker are bits of POD and corresponding expected output. This is
-# used to test specific features or problems with Pod::Text::Color. The input
-# and output are separated by lines containing only ###.
-
-__DATA__
-
-###
-=head1 WRAPPING
-
-B<I<Do>> I<B<not>> B<I<include>> B<I<formatting codes when>> B<I<wrapping>>.
-###
-WRAPPING
- Do not include formatting codes when wrapping.
-
-###
-
-###
-=head1 TAG WIDTH
-
-=over 10
-
-=item 12345678
+# List of snippets run by this test.
+my @snippets = qw(escape-wrapping tag-width tag-wrapping width wrapping);
-A
-
-=item B<12345678>
-
-B
-
-=item 1Z<>
-
-C
-
-=item B<1>
-
-D
-
-=back
-###
-TAG WIDTH
- 12345678 A
-
- 12345678 B
-
- 1 C
-
- 1 D
-
-###
+# Run all the tests.
+for my $snippet (@snippets) {
+ test_snippet('Pod::Text::Color', "color/$snippet");
+}
diff --git a/cpan/podlators/t/text/empty.t b/cpan/podlators/t/text/empty.t
index 0b8823a3e5..e03a03c4a3 100644
--- a/cpan/podlators/t/text/empty.t
+++ b/cpan/podlators/t/text/empty.t
@@ -1,11 +1,13 @@
#!/usr/bin/perl -w
#
-# text-empty.t -- Test Pod::Text with a document that produces only errors.
+# Test Pod::Text with a document that produces only errors.
#
-# Copyright 2013 Russ Allbery <rra@cpan.org>
+# Copyright 2013, 2018 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
BEGIN {
chdir 't' if -d 't';
diff --git a/cpan/podlators/t/text/encoding.t b/cpan/podlators/t/text/encoding.t
index 7fe7401d59..7a6b6f2801 100644
--- a/cpan/podlators/t/text/encoding.t
+++ b/cpan/podlators/t/text/encoding.t
@@ -1,12 +1,14 @@
#!/usr/bin/perl -w
#
-# text-encoding.t -- Test Pod::Text with various weird encoding combinations.
+# Test Pod::Text with various weird encoding combinations.
#
-# Copyright 2002, 2004, 2006, 2007, 2008, 2009, 2012, 2015
+# Copyright 2002, 2004, 2006-2009, 2012, 2015, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
BEGIN {
chdir 't' if -d 't';
diff --git a/cpan/podlators/t/text/options.t b/cpan/podlators/t/text/options.t
index ab9350c7f0..d191cf00f9 100644
--- a/cpan/podlators/t/text/options.t
+++ b/cpan/podlators/t/text/options.t
@@ -2,11 +2,13 @@
#
# Additional tests for Pod::Text options.
#
-# Copyright 2002, 2004, 2006, 2008, 2009, 2012, 2013, 2015
+# Copyright 2002, 2004, 2006, 2008-2009, 2012-2013, 2015, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
BEGIN {
chdir 't' if -d 't';
diff --git a/cpan/podlators/t/text/overstrike.t b/cpan/podlators/t/text/overstrike.t
index c5496bb871..7433264cb3 100644
--- a/cpan/podlators/t/text/overstrike.t
+++ b/cpan/podlators/t/text/overstrike.t
@@ -1,12 +1,14 @@
#!/usr/bin/perl -w
#
-# overstrike.t -- Additional specialized tests for Pod::Text::Overstrike.
+# Additional specialized tests for Pod::Text::Overstrike.
#
-# Copyright 2002, 2004, 2006, 2009, 2012, 2013
+# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
BEGIN {
chdir 't' if -d 't';
diff --git a/cpan/podlators/t/text/perlio.t b/cpan/podlators/t/text/perlio.t
index c95f682b68..1b6523d328 100644
--- a/cpan/podlators/t/text/perlio.t
+++ b/cpan/podlators/t/text/perlio.t
@@ -1,12 +1,14 @@
#!/usr/bin/perl -w
#
-# text-perlio.t -- Test Pod::Text with a PerlIO UTF-8 encoding layer.
+# Test Pod::Text with a PerlIO UTF-8 encoding layer.
#
-# Copyright 2002, 2004, 2006, 2007, 2008, 2009, 2010, 2012, 2014
+# Copyright 2002, 2004, 2006-2010, 2012, 2014, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
BEGIN {
chdir 't' if -d 't';
diff --git a/cpan/podlators/t/text/termcap.t b/cpan/podlators/t/text/termcap.t
index 4b30c62fc3..4a9893a9da 100644
--- a/cpan/podlators/t/text/termcap.t
+++ b/cpan/podlators/t/text/termcap.t
@@ -1,125 +1,37 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
-# termcap.t -- Additional specialized tests for Pod::Text::Termcap.
+# Test Pod::Text::Termcap behavior with various snippets.
#
-# Copyright 2002, 2004, 2006, 2009, 2012, 2013, 2014
+# Copyright 2002, 2004, 2006, 2009, 2012-2014, 2018
# Russ Allbery <rra@cpan.org>
#
# 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';
- }
- unshift (@INC, '../blib/lib');
- $| = 1;
-}
-
+use 5.006;
use strict;
+use warnings;
-use File::Spec;
-use Test::More tests => 4;
+use lib 't/lib';
-BEGIN { use_ok ('Pod::Text::Termcap') }
+use Test::More tests => 11;
+use Test::Podlators qw(test_snippet);
-# Find the path to the test source files. This requires some fiddling when
-# these tests are run as part of Perl core.
-sub source_path {
- my $file = shift;
- if ($ENV{PERL_CORE}) {
- my $updir = File::Spec->updir;
- my $dir = File::Spec->catdir ($updir, 'lib', 'Pod', 't', 'data');
- return File::Spec->catfile ($dir, $file);
- } else {
- return File::Spec->catfile ('data', $file);
- }
+# Load the module.
+BEGIN {
+ use_ok('Pod::Text::Termcap');
}
# Hard-code a few values to try to get reproducible results.
$ENV{COLUMNS} = 80;
$ENV{TERM} = 'xterm';
-$ENV{TERMPATH} = source_path ('termcap');
+$ENV{TERMPATH} = File::Spec->catfile('t', 'data', 'termcap');
$ENV{TERMCAP} = 'xterm:co=#80:do=^J:md=\E[1m:us=\E[4m:me=\E[m';
-my $parser = Pod::Text::Termcap->new;
-isa_ok ($parser, 'Pod::Text::Termcap', 'Parser module');
-my $n = 1;
-while (<DATA>) {
- next until $_ eq "###\n";
- open (TMP, "> tmp$$.pod") or die "Cannot create tmp$$.pod: $!\n";
- while (<DATA>) {
- last if $_ eq "###\n";
- print TMP $_;
- }
- close TMP;
- 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";
- my $output;
- {
- local $/;
- $output = <TMP>;
- }
- close TMP;
- 1 while unlink ("tmp$$.pod", "out$$.tmp");
- my $expected = '';
- while (<DATA>) {
- last if $_ eq "###\n";
- $expected .= $_;
- }
- is ($output, $expected, "Output correct for test $n");
- $n++;
-}
-
-# Below the marker are bits of POD and corresponding expected output. This is
-# used to test specific features or problems with Pod::Text::Termcap. The
-# input and output are separated by lines containing only ###.
-
-__DATA__
-
-###
-=head1 WRAPPING
-
-B<I<Do>> I<B<not>> B<I<include>> B<I<formatting codes when>> B<I<wrapping>>.
-###
-WRAPPING
- Do not include formatting codes when wrapping.
-
-###
-
-###
-=head1 TAG WIDTH
-
-=over 10
-
-=item 12345678
+# List of snippets run by this test.
+my @snippets = qw(escape-wrapping tag-width tag-wrapping width wrapping);
-A
-
-=item B<12345678>
-
-B
-
-=item 1Z<>
-
-C
-
-=item B<1>
-
-D
-
-=back
-###
-TAG WIDTH
- 12345678 A
-
- 12345678 B
-
- 1 C
-
- 1 D
-
-###
+# Run all the tests.
+for my $snippet (@snippets) {
+ test_snippet('Pod::Text::Termcap', "termcap/$snippet");
+}
diff --git a/cpan/podlators/t/text/utf8.t b/cpan/podlators/t/text/utf8.t
index e468c57d0d..a04010ea10 100644
--- a/cpan/podlators/t/text/utf8.t
+++ b/cpan/podlators/t/text/utf8.t
@@ -1,12 +1,14 @@
#!/usr/bin/perl -w
#
-# text-utf8.t -- Test Pod::Text with UTF-8 input.
+# Test Pod::Text with UTF-8 input.
#
-# Copyright 2002, 2004, 2006, 2007, 2008, 2009, 2012, 2014
+# Copyright 2002, 2004, 2006-2009, 2012, 2014, 2018
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
+#
+# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
BEGIN {
chdir 't' if -d 't';