summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
Diffstat (limited to 'cpan')
-rw-r--r--cpan/podlators/Makefile.PL11
-rw-r--r--cpan/podlators/lib/Pod/Man.pm21
-rw-r--r--cpan/podlators/lib/Pod/ParseLink.pm8
-rw-r--r--cpan/podlators/lib/Pod/Text.pm31
-rw-r--r--cpan/podlators/lib/Pod/Text/Color.pm9
-rw-r--r--cpan/podlators/lib/Pod/Text/Overstrike.pm6
-rw-r--r--cpan/podlators/lib/Pod/Text/Termcap.pm72
-rw-r--r--cpan/podlators/scripts/pod2man.PL4
-rw-r--r--cpan/podlators/scripts/pod2text.PL4
-rw-r--r--cpan/podlators/t/data/perl.conf2
-rw-r--r--cpan/podlators/t/data/snippets/termcap/term-unknown13
-rw-r--r--cpan/podlators/t/data/snippets/text/alt38
-rw-r--r--cpan/podlators/t/data/snippets/text/c-with-spaces11
-rw-r--r--cpan/podlators/t/data/snippets/text/code33
-rw-r--r--cpan/podlators/t/data/snippets/text/error-die25
-rw-r--r--cpan/podlators/t/data/snippets/text/error-none19
-rw-r--r--cpan/podlators/t/data/snippets/text/error-normal22
-rw-r--r--cpan/podlators/t/data/snippets/text/error-pod25
-rw-r--r--cpan/podlators/t/data/snippets/text/error-stderr22
-rw-r--r--cpan/podlators/t/data/snippets/text/error-stderr-opt22
-rw-r--r--cpan/podlators/t/data/snippets/text/for28
-rw-r--r--cpan/podlators/t/data/snippets/text/late-encoding28
-rw-r--r--cpan/podlators/t/data/snippets/text/link-rt11
-rw-r--r--cpan/podlators/t/data/snippets/text/link-url11
-rw-r--r--cpan/podlators/t/data/snippets/text/margin34
-rw-r--r--cpan/podlators/t/data/snippets/text/nonbreaking-space11
-rw-r--r--cpan/podlators/t/data/snippets/text/nourls14
-rw-r--r--cpan/podlators/t/data/snippets/text/periods11
-rw-r--r--cpan/podlators/t/data/snippets/text/quotes-opt14
-rw-r--r--cpan/podlators/t/data/snippets/text/s-whitespace11
-rw-r--r--cpan/podlators/t/data/snippets/text/sentence-spacing18
-rw-r--r--cpan/podlators/t/data/snippets/text/utf838
-rw-r--r--cpan/podlators/t/data/snippets/text/verbatim18
-rw-r--r--cpan/podlators/t/data/termcap1
-rw-r--r--cpan/podlators/t/docs/pod-spelling.t6
-rw-r--r--cpan/podlators/t/docs/pod.t6
-rw-r--r--cpan/podlators/t/docs/spdx-license.t32
-rw-r--r--cpan/podlators/t/docs/synopsis.t6
-rw-r--r--cpan/podlators/t/general/basic.t4
-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.pm8
-rw-r--r--cpan/podlators/t/lib/Test/RRA.pm83
-rw-r--r--cpan/podlators/t/lib/Test/RRA/Config.pm16
-rw-r--r--cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm36
-rw-r--r--cpan/podlators/t/man/devise-date.t6
-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/iso-8859-1.t6
-rw-r--r--cpan/podlators/t/man/no-encode.t17
-rw-r--r--cpan/podlators/t/man/snippets.t4
-rw-r--r--cpan/podlators/t/man/utf8-io.t15
-rw-r--r--cpan/podlators/t/style/minimum-version.t6
-rw-r--r--cpan/podlators/t/style/module-version.t7
-rw-r--r--cpan/podlators/t/style/obsolete-strings.t (renamed from cpan/podlators/t/docs/urls.t)27
-rw-r--r--cpan/podlators/t/style/strict.t50
-rw-r--r--cpan/podlators/t/text/basic.t157
-rw-r--r--cpan/podlators/t/text/color.t4
-rw-r--r--cpan/podlators/t/text/encoding.t158
-rw-r--r--cpan/podlators/t/text/options.t368
-rw-r--r--cpan/podlators/t/text/snippets.t38
-rw-r--r--cpan/podlators/t/text/termcap.t24
-rw-r--r--cpan/podlators/t/text/utf8.t128
64 files changed, 819 insertions, 1059 deletions
diff --git a/cpan/podlators/Makefile.PL b/cpan/podlators/Makefile.PL
index a2008fefc7..ff76df5f9f 100644
--- a/cpan/podlators/Makefile.PL
+++ b/cpan/podlators/Makefile.PL
@@ -4,7 +4,7 @@
# which only supports that build method, and because it is a dependency of
# other build systems like Module::Build.
#
-# Copyright 1999-2001, 2008, 2010, 2012, 2014-2016, 2018
+# Copyright 1999-2001, 2008, 2010, 2012, 2014-2016, 2018-2019
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
@@ -12,7 +12,7 @@
#
# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -89,7 +89,7 @@ my %metadata = (
LICENSE => 'perl_5',
EXE_FILES => [scripts('pod2text', 'pod2man')],
VERSION_FROM => 'lib/Pod/Man.pm',
- MIN_PERL_VERSION => '5.006',
+ MIN_PERL_VERSION => '5.008',
# Use *.PL files to generate the driver scripts so that we get the correct
# invocation of Perl on non-UNIX platforms.
@@ -111,10 +111,7 @@ my %metadata = (
realclean => { FILES => scalar(scripts('pod2text', 'pod2man')) },
# Dependencies on other modules.
- PREREQ_PM => {
- 'Encode' => 0,
- 'Pod::Simple' => 3.06,
- },
+ PREREQ_PM => { 'Pod::Simple' => 3.06 },
# Older versions of ExtUtils::MakeMaker don't pick up nested test
# directories by default.
diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
index 6bd6d4f34e..7e6563d930 100644
--- a/cpan/podlators/lib/Pod/Man.pm
+++ b/cpan/podlators/lib/Pod/Man.pm
@@ -14,7 +14,7 @@
package Pod::Man;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -24,7 +24,9 @@ use vars qw(@ISA %ESCAPES $PREAMBLE $VERSION);
use Carp qw(carp croak);
use Pod::Simple ();
-# Conditionally import Encode and set $HAS_ENCODE if it is available.
+# Conditionally import Encode and set $HAS_ENCODE if it is available. This is
+# required to support building as part of Perl core, since podlators is built
+# before Encode is.
our $HAS_ENCODE;
BEGIN {
$HAS_ENCODE = eval { require Encode };
@@ -32,7 +34,7 @@ BEGIN {
@ISA = qw(Pod::Simple);
-$VERSION = '4.12';
+$VERSION = '4.13';
# Set the debugging level. If someone has inserted a debug function into this
# class already, use that. Otherwise, use any Pod::Simple debug function
@@ -245,13 +247,8 @@ sub init_quotes {
sub init_page {
my ($self) = @_;
- # We used to try first to get the version number from a local binary, but
- # we shouldn't need that any more. Get the version from the running Perl.
- # Work a little magic to handle subversions correctly under both the
- # pre-5.6 and the post-5.6 version numbering schemes.
- my @version = ($] =~ /^(\d+)\.(\d{3})(\d{0,3})$/);
- $version[2] ||= 0;
- $version[2] *= 10 ** (3 - length $version[2]);
+ # Get the version from the running Perl.
+ my @version = ($] =~ /^(\d+)\.(\d{3})(\d+)$/);
for (@version) { $_ += 0 }
my $version = join ('.', @version);
@@ -799,7 +796,7 @@ sub start_document {
eval {
my @options = (output => 1, details => 1);
my @layers = PerlIO::get_layers (*{$$self{output_fh}}, @options);
- if ($layers[-1] & PerlIO::F_UTF8 ()) {
+ if ($layers[-1] && ($layers[-1] & PerlIO::F_UTF8 ())) {
$$self{ENCODE} = 0;
}
}
@@ -2012,7 +2009,7 @@ are mine).
=head1 COPYRIGHT AND LICENSE
-Copyright 1999-2010, 2012-2018 Russ Allbery <rra@cpan.org>
+Copyright 1999-2010, 2012-2019 Russ Allbery <rra@cpan.org>
Substantial contributions by Sean Burke <sburke@cpan.org>.
diff --git a/cpan/podlators/lib/Pod/ParseLink.pm b/cpan/podlators/lib/Pod/ParseLink.pm
index 6f11eeba1d..f910280862 100644
--- a/cpan/podlators/lib/Pod/ParseLink.pm
+++ b/cpan/podlators/lib/Pod/ParseLink.pm
@@ -13,7 +13,7 @@
package Pod::ParseLink;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -23,7 +23,7 @@ use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(parselink);
-$VERSION = '4.12';
+$VERSION = '4.13';
##############################################################################
# Implementation
@@ -167,11 +167,11 @@ L<perlpodspec> for more information.
=head1 AUTHOR
-Russ Allbery <rra@cpan.org>.
+Russ Allbery <rra@cpan.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2001, 2008, 2009, 2014, 2018 Russ Allbery <rra@cpan.org>
+Copyright 2001, 2008, 2009, 2014, 2018-2019 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.
diff --git a/cpan/podlators/lib/Pod/Text.pm b/cpan/podlators/lib/Pod/Text.pm
index d428621379..9ffcf74ebb 100644
--- a/cpan/podlators/lib/Pod/Text.pm
+++ b/cpan/podlators/lib/Pod/Text.pm
@@ -14,7 +14,7 @@
package Pod::Text;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -30,7 +30,7 @@ use Pod::Simple ();
# We have to export pod2text for backward compatibility.
@EXPORT = qw(pod2text);
-$VERSION = '4.12';
+$VERSION = '4.13';
# 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.
@@ -39,16 +39,8 @@ if ($Pod::Simple::VERSION ge 3.30) {
$NBSP = $Pod::Simple::nbsp;
$SHY = $Pod::Simple::shy;
} else {
- if ($] ge 5.007_003) {
- $NBSP = chr utf8::unicode_to_native(0xA0);
- $SHY = chr utf8::unicode_to_native(0xAD);
- } elsif (Pod::Simple::ASCII) {
- $NBSP = "\xA0";
- $SHY = "\xAD";
- } else {
- $NBSP = "\x41";
- $SHY = "\xCA";
- }
+ $NBSP = chr utf8::unicode_to_native(0xA0);
+ $SHY = chr utf8::unicode_to_native(0xAD);
}
##############################################################################
@@ -247,7 +239,7 @@ sub wrap {
my $spaces = ' ' x $$self{MARGIN};
my $width = $$self{opt_width} - $$self{MARGIN};
while (length > $width) {
- if (s/^([^\n]{0,$width})\s+// || s/^([^\n]{$width})//) {
+ if (s/^([^\n]{0,$width})[ \t\n]+// || s/^([^\n]{$width})//) {
$output .= $spaces . $1 . "\n";
} else {
last;
@@ -265,14 +257,16 @@ sub reformat {
local $_ = shift;
# If we're trying to preserve two spaces after sentences, do some munging
- # to support that. Otherwise, smash all repeated whitespace.
+ # to support that. Otherwise, smash all repeated whitespace. Be careful
+ # not to use \s here, which in Unicode input may match non-breaking spaces
+ # that we don't want to smash.
if ($$self{opt_sentence}) {
s/ +$//mg;
s/\.\n/. \n/g;
s/\n/ /g;
s/ +/ /g;
} else {
- s/\s+/ /g;
+ s/[ \t\n]+/ /g;
}
return $self->wrap ($_);
}
@@ -333,15 +327,14 @@ sub start_document {
# When UTF-8 output is set, check whether our output file handle already
# has a PerlIO encoding layer set. If it does not, we'll need to encode
- # our output before printing it (handled in the output() sub). Wrap the
- # check in an eval to handle versions of Perl without PerlIO.
+ # our output before printing it (handled in the output() sub).
$$self{ENCODE} = 0;
if ($$self{opt_utf8}) {
$$self{ENCODE} = 1;
eval {
my @options = (output => 1, details => 1);
my $flag = (PerlIO::get_layers ($$self{output_fh}, @options))[-1];
- if ($flag & PerlIO::F_UTF8 ()) {
+ if ($flag && ($flag & PerlIO::F_UTF8 ())) {
$$self{ENCODE} = 0;
$$self{ENCODING} = 'UTF-8';
}
@@ -1006,7 +999,7 @@ how to use Pod::Simple.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999-2002, 2004, 2006, 2008-2009, 2012-2016, 2018 Russ Allbery
+Copyright 1999-2002, 2004, 2006, 2008-2009, 2012-2016, 2018-2019 Russ Allbery
<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
diff --git a/cpan/podlators/lib/Pod/Text/Color.pm b/cpan/podlators/lib/Pod/Text/Color.pm
index d94c075940..09430d3d7f 100644
--- a/cpan/podlators/lib/Pod/Text/Color.pm
+++ b/cpan/podlators/lib/Pod/Text/Color.pm
@@ -12,7 +12,7 @@
package Pod::Text::Color;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -23,7 +23,7 @@ use vars qw(@ISA $VERSION);
@ISA = qw(Pod::Text);
-$VERSION = '4.12';
+$VERSION = '4.13';
##############################################################################
# Overrides
@@ -97,9 +97,6 @@ sub wrap {
# $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 $code = '(?:\e\[[\d;]+m)';
my $char = "(?>$code*[^\\n])";
my $shortchar = '^(' . $char . "{0,$width}(?>$code*)" . ')(?:\s+|\z)';
@@ -185,7 +182,7 @@ Russ Allbery <rra@cpan.org>.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2001, 2004, 2006, 2008, 2009, 2018 Russ Allbery
+Copyright 1999, 2001, 2004, 2006, 2008, 2009, 2018-2019 Russ Allbery
<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
diff --git a/cpan/podlators/lib/Pod/Text/Overstrike.pm b/cpan/podlators/lib/Pod/Text/Overstrike.pm
index cc7c697120..a0dee0ae8c 100644
--- a/cpan/podlators/lib/Pod/Text/Overstrike.pm
+++ b/cpan/podlators/lib/Pod/Text/Overstrike.pm
@@ -19,7 +19,7 @@
package Pod::Text::Overstrike;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -29,7 +29,7 @@ use Pod::Text ();
@ISA = qw(Pod::Text);
-$VERSION = '4.12';
+$VERSION = '4.13';
##############################################################################
# Overrides
@@ -185,7 +185,7 @@ created by Russ Allbery <rra@cpan.org>. Subsequently updated by Russ Allbery.
Copyright 2000 by Joe Smith <Joe.Smith@inwap.com>
-Copyright 2001, 2004, 2008, 2014, 2018 by Russ Allbery <rra@cpan.org>
+Copyright 2001, 2004, 2008, 2014, 2018-2019 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.
diff --git a/cpan/podlators/lib/Pod/Text/Termcap.pm b/cpan/podlators/lib/Pod/Text/Termcap.pm
index fdc7e8bc23..b9d402ad65 100644
--- a/cpan/podlators/lib/Pod/Text/Termcap.pm
+++ b/cpan/podlators/lib/Pod/Text/Termcap.pm
@@ -12,7 +12,7 @@
package Pod::Text::Termcap;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -24,7 +24,7 @@ use vars qw(@ISA $VERSION);
@ISA = qw(Pod::Text);
-$VERSION = '4.12';
+$VERSION = '4.13';
##############################################################################
# Overrides
@@ -36,14 +36,6 @@ sub new {
my ($self, %args) = @_;
my ($ospeed, $term, $termios);
- # $ENV{HOME} is usually not set on Windows. The default Term::Cap path
- # may not work on Solaris.
- unless (exists $ENV{TERMPATH}) {
- my $home = exists $ENV{HOME} ? "$ENV{HOME}/.termcap:" : '';
- $ENV{TERMPATH} =
- "${home}/etc/termcap:/usr/share/misc/termcap:/usr/share/lib/termcap";
- }
-
# Fall back on a hard-coded terminal speed if POSIX::Termios isn't
# available (such as on VMS).
eval { $termios = POSIX::Termios->new };
@@ -80,10 +72,12 @@ sub new {
# 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";
+ # If we were unable to get any of the formatting sequences, don't attempt
+ # that type of formatting. This will do weird things if bold or underline
+ # were available but normal wasn't, but hopefully that will never happen.
+ $$self{BOLD} = $bold || q{};
+ $$self{UNDL} = $undl || q{};
+ $$self{NORM} = $norm || q{};
return $self;
}
@@ -106,11 +100,19 @@ 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}" }
+# Return a regex that matches a formatting sequence. This will only be valid
+# if we were able to get at least some termcap information.
+sub format_regex {
+ my ($self) = @_;
+ my @codes = ($self->{BOLD}, $self->{UNDL}, $self->{NORM});
+ return join(q{|}, map { $_ eq q{} ? () : "\Q$_\E" } @codes);
+}
+
# 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 $pattern = "(" . $self->format_regex() . ")";
my $current;
while ($line =~ /$pattern/g) {
my $code = $1;
@@ -147,15 +149,17 @@ sub wrap {
my $spaces = ' ' x $$self{MARGIN};
my $width = $$self{opt_width} - $$self{MARGIN};
+ # If we were unable to find any termcap sequences, use Pod::Text wrapping.
+ if ($self->{BOLD} eq q{} && $self->{UNDL} eq q{} && $self->{NORM} eq q{}) {
+ return $self->SUPER::wrap($_);
+ }
+
# $code 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 $code = "(?:\Q$$self{BOLD}\E|\Q$$self{UNDL}\E|\Q$$self{NORM}\E)";
+ my $code = "(?:" . $self->format_regex() . ")";
my $char = "(?>$code*[^\\n])";
my $shortchar = '^(' . $char . "{0,$width}(?>$code*)" . ')(?:\s+|\z)';
my $longchar = '^(' . $char . "{$width})";
@@ -225,34 +229,20 @@ text using the correct termcap escape sequences for the current terminal.
Apart from the format codes, it in all ways functions like Pod::Text. See
L<Pod::Text> for details and available options.
-=head1 ENVIRONMENT
-
-This module sets the TERMPATH environment variable globally to:
-
- $HOME/.termcap:/etc/termcap:/usr/share/misc/termcap:/usr/share/lib/termcap
-
-if it isn't already set. (The first entry is omitted if the HOME
-environment variable isn't set.) This is a (very old) workaround for
-problems finding termcap information on older versions of Solaris, and is
-not good module behavior. Please do not rely on this behavior; it may be
-dropped in a future release.
-
-=head1 NOTES
-
-This module uses Term::Cap to retrieve the formatting escape sequences for
-the current terminal, and falls back on the ECMA-48 (the same in this
-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.
+This module uses L<Term::Cap> to find the correct terminal settings. See the
+documentation of that module for how it finds terminal database information
+and how to override that behavior if necessary. If unable to find control
+strings for bold and underscore formatting, that formatting is skipped,
+resulting in the same output as Pod::Text.
=head1 AUTHOR
-Russ Allbery <rra@cpan.org>.
+Russ Allbery <rra@cpan.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 1999, 2001-2002, 2004, 2006, 2008-2009, 2014-2015, 2018 Russ Allbery
-<rra@cpan.org>
+Copyright 1999, 2001-2002, 2004, 2006, 2008-2009, 2014-2015, 2018-2019 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.
diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
index bc455d8829..d6e685d201 100644
--- a/cpan/podlators/scripts/pod2man.PL
+++ b/cpan/podlators/scripts/pod2man.PL
@@ -4,7 +4,7 @@
# required for proper start-up code on non-UNIX platforms, and is used inside
# Perl core.
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -417,7 +417,7 @@ B<pod2man> by Larry Wall and Tom Christiansen.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2018 Russ Allbery
+Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2019 Russ Allbery
<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
diff --git a/cpan/podlators/scripts/pod2text.PL b/cpan/podlators/scripts/pod2text.PL
index bae8574152..be06960ad7 100644
--- a/cpan/podlators/scripts/pod2text.PL
+++ b/cpan/podlators/scripts/pod2text.PL
@@ -4,7 +4,7 @@
# required for proper start-up code on non-UNIX platforms, and is used inside
# Perl core.
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -346,7 +346,7 @@ Russ Allbery <rra@cpan.org>.
=head1 COPYRIGHT AND LICENSE
-Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2018 Russ Allbery
+Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2019 Russ Allbery
<rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
diff --git a/cpan/podlators/t/data/perl.conf b/cpan/podlators/t/data/perl.conf
index 8b76b1c8fb..ca0556858b 100644
--- a/cpan/podlators/t/data/perl.conf
+++ b/cpan/podlators/t/data/perl.conf
@@ -1,7 +1,7 @@
# Configuration for Perl tests. -*- perl -*-
# Default minimum version requirement.
-$MINIMUM_VERSION = '5.006';
+$MINIMUM_VERSION = '5.008';
# File must end with this line.
1;
diff --git a/cpan/podlators/t/data/snippets/termcap/term-unknown b/cpan/podlators/t/data/snippets/termcap/term-unknown
new file mode 100644
index 0000000000..2f06077433
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/termcap/term-unknown
@@ -0,0 +1,13 @@
+[name]
+Rendering with unknown terminal type
+
+[input]
+=head1 UNKNOWN
+
+An unknown I<terminal type> B<should> C<suppress> all termcap-based
+formatting and still wrap successfully.
+
+[output]
+UNKNOWN
+ An unknown terminal type should "suppress" all termcap-based formatting
+ and still wrap successfully.
diff --git a/cpan/podlators/t/data/snippets/text/alt b/cpan/podlators/t/data/snippets/text/alt
new file mode 100644
index 0000000000..9f4e9b73ab
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/alt
@@ -0,0 +1,38 @@
+[name]
+Alternate output
+
+[options]
+alt 1
+
+[input]
+=head1 SAMPLE
+
+=over 4
+
+=item F
+
+Paragraph.
+
+=item Bar
+
+=item B
+
+Paragraph.
+
+=item Longer
+
+Paragraph.
+
+=back
+
+[output]
+
+==== SAMPLE ====
+
+: F Paragraph.
+
+: Bar
+: B Paragraph.
+
+: Longer
+ Paragraph.
diff --git a/cpan/podlators/t/data/snippets/text/c-with-spaces b/cpan/podlators/t/data/snippets/text/c-with-spaces
new file mode 100644
index 0000000000..466e95e385
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/c-with-spaces
@@ -0,0 +1,11 @@
+[name]
+C<> with spaces
+
+[input]
+=head1 CE<lt>E<gt> WITH SPACES
+
+What does C<< this. >> end up looking like?
+
+[output]
+C<> WITH SPACES
+ What does "this." end up looking like?
diff --git a/cpan/podlators/t/data/snippets/text/code b/cpan/podlators/t/data/snippets/text/code
new file mode 100644
index 0000000000..89c06bb43e
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/code
@@ -0,0 +1,33 @@
+[name]
+code option
+
+[options]
+code 1
+
+[input]
+This is some random text.
+This is more random text.
+
+This is some random text.
+This is more random text.
+
+=head1 SAMPLE
+
+This is POD.
+
+=cut
+
+This is more random text.
+
+[output]
+This is some random text.
+This is more random text.
+
+This is some random text.
+This is more random text.
+
+SAMPLE
+ This is POD.
+
+
+This is more random text.
diff --git a/cpan/podlators/t/data/snippets/text/error-die b/cpan/podlators/t/data/snippets/text/error-die
new file mode 100644
index 0000000000..ab4a493bd5
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/error-die
@@ -0,0 +1,25 @@
+[name]
+Errors throw exceptions
+
+[options]
+errors die
+
+[input]
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+
+[output]
+ Foo Bar.
+
+NEXT
+
+[errors]
+Pod input around line 7: You forgot a '=back' before '=head1'
+
+[exception]
+POD document had syntax errors
diff --git a/cpan/podlators/t/data/snippets/text/error-none b/cpan/podlators/t/data/snippets/text/error-none
new file mode 100644
index 0000000000..b0fa47b599
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/error-none
@@ -0,0 +1,19 @@
+[name]
+Suppress errors
+
+[options]
+errors none
+
+[input]
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+
+[output]
+ Foo Bar.
+
+NEXT
diff --git a/cpan/podlators/t/data/snippets/text/error-normal b/cpan/podlators/t/data/snippets/text/error-normal
new file mode 100644
index 0000000000..b99111661a
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/error-normal
@@ -0,0 +1,22 @@
+[name]
+Normal error handling
+
+[input]
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+
+[output]
+ 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'
diff --git a/cpan/podlators/t/data/snippets/text/error-pod b/cpan/podlators/t/data/snippets/text/error-pod
new file mode 100644
index 0000000000..807de010f8
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/error-pod
@@ -0,0 +1,25 @@
+[name]
+Errors to POD source
+
+[options]
+errors pod
+
+[input]
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+
+[output]
+ 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'
diff --git a/cpan/podlators/t/data/snippets/text/error-stderr b/cpan/podlators/t/data/snippets/text/error-stderr
new file mode 100644
index 0000000000..e1ec95b6f5
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/error-stderr
@@ -0,0 +1,22 @@
+[name]
+Errors to standard error
+
+[options]
+errors stderr
+
+[input]
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+
+[output]
+ Foo Bar.
+
+NEXT
+
+[errors]
+Pod input around line 7: You forgot a '=back' before '=head1'
diff --git a/cpan/podlators/t/data/snippets/text/error-stderr-opt b/cpan/podlators/t/data/snippets/text/error-stderr-opt
new file mode 100644
index 0000000000..7547f846da
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/error-stderr-opt
@@ -0,0 +1,22 @@
+[name]
+Errors to standard error with stderr option
+
+[options]
+stderr 1
+
+[input]
+=over 4
+
+=item Foo
+
+Bar.
+
+=head1 NEXT
+
+[output]
+ Foo Bar.
+
+NEXT
+
+[errors]
+Pod input around line 7: You forgot a '=back' before '=head1'
diff --git a/cpan/podlators/t/data/snippets/text/for b/cpan/podlators/t/data/snippets/text/for
new file mode 100644
index 0000000000..56fb767344
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/for
@@ -0,0 +1,28 @@
+[name]
+Handling of =for
+
+[input]
+=head1 Test of =for
+
+=for comment
+This won't be seen.
+
+Yes.
+
+=for text
+This should be seen.
+
+=for TEXT As should this.
+
+=for man
+But this shouldn't.
+
+Some more text.
+
+[output]
+Test of =for
+ Yes.
+
+This should be seen.
+As should this.
+ Some more text.
diff --git a/cpan/podlators/t/data/snippets/text/late-encoding b/cpan/podlators/t/data/snippets/text/late-encoding
new file mode 100644
index 0000000000..99c0de938a
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/late-encoding
@@ -0,0 +1,28 @@
+[name]
+Late use of =encoding
+
+[input]
+=pod
+
+=head1 NAME
+
+This is the first ascii text
+
+=encoding utf8
+
+=over 4
+
+=item ⇒This is the first non-ascii text⇐
+
+This is the second ascii text
+
+=back
+
+=cut
+
+[output]
+NAME
+ This is the first ascii text
+
+ ⇒This is the first non-ascii text⇐
+ This is the second ascii text
diff --git a/cpan/podlators/t/data/snippets/text/link-rt b/cpan/podlators/t/data/snippets/text/link-rt
new file mode 100644
index 0000000000..8669874f71
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/link-rt
@@ -0,0 +1,11 @@
+[name]
+Link to an RT ticket
+
+[input]
+=head1 RT LINK
+
+L<[perl #12345]|https://rt.cpan.org/12345>
+
+[output]
+RT LINK
+ [perl #12345] <https://rt.cpan.org/12345>
diff --git a/cpan/podlators/t/data/snippets/text/link-url b/cpan/podlators/t/data/snippets/text/link-url
new file mode 100644
index 0000000000..7ef33fd172
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/link-url
@@ -0,0 +1,11 @@
+[name]
+Link to a URL
+
+[input]
+=head1 LINK TO URL
+
+This is a L<link|http://www.example.com/> to a URL.
+
+[output]
+LINK TO URL
+ This is a link <http://www.example.com/> to a URL.
diff --git a/cpan/podlators/t/data/snippets/text/margin b/cpan/podlators/t/data/snippets/text/margin
new file mode 100644
index 0000000000..786f06b97c
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/margin
@@ -0,0 +1,34 @@
+[name]
+margin option
+
+[options]
+margin 4
+
+[input]
+=head1 SAMPLE
+
+This is some body text that is long enough to be a paragraph that wraps,
+thereby testing margins with wrapped paragraphs.
+
+ This is some verbatim text.
+
+=over 6
+
+=item Test
+
+This is a test of an indented paragraph.
+
+This is another indented paragraph.
+
+=back
+
+[output]
+ SAMPLE
+ This is some body text that is long enough to be a paragraph that
+ wraps, thereby testing margins with wrapped paragraphs.
+
+ This is some verbatim text.
+
+ Test This is a test of an indented paragraph.
+
+ This is another indented paragraph.
diff --git a/cpan/podlators/t/data/snippets/text/nonbreaking-space b/cpan/podlators/t/data/snippets/text/nonbreaking-space
new file mode 100644
index 0000000000..d57ed73ca1
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/nonbreaking-space
@@ -0,0 +1,11 @@
+[name]
+Multiple non-breaking spaces
+
+[input]
+=head1 Test of SE<lt>E<gt>
+
+This is some S< > whitespace.
+
+[output]
+Test of S<>
+ This is some whitespace.
diff --git a/cpan/podlators/t/data/snippets/text/nourls b/cpan/podlators/t/data/snippets/text/nourls
new file mode 100644
index 0000000000..a34202a061
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/nourls
@@ -0,0 +1,14 @@
+[name]
+nourls option
+
+[options]
+nourls 1
+
+[input]
+=head1 URL suppression
+
+L<anchor|http://www.example.com/>
+
+[output]
+URL suppression
+ anchor
diff --git a/cpan/podlators/t/data/snippets/text/periods b/cpan/podlators/t/data/snippets/text/periods
new file mode 100644
index 0000000000..44fe3a2bb8
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/periods
@@ -0,0 +1,11 @@
+[name]
+Quoting of periods
+
+[input]
+=head1 PERIODS
+
+This C<.> should be quoted.
+
+[output]
+PERIODS
+ This "." should be quoted.
diff --git a/cpan/podlators/t/data/snippets/text/quotes-opt b/cpan/podlators/t/data/snippets/text/quotes-opt
new file mode 100644
index 0000000000..4d2e6b6408
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/quotes-opt
@@ -0,0 +1,14 @@
+[name]
+quotes option
+
+[options]
+quotes <<<>>>
+
+[input]
+=head1 FOO C<BAR> BAZ
+
+Foo C<bar> baz.
+
+[output]
+FOO <<<BAR>>> BAZ
+ Foo <<<bar>>> baz.
diff --git a/cpan/podlators/t/data/snippets/text/s-whitespace b/cpan/podlators/t/data/snippets/text/s-whitespace
new file mode 100644
index 0000000000..ff4febc6e7
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/s-whitespace
@@ -0,0 +1,11 @@
+[name]
+S<> whitespace
+
+[input]
+=head1 Test of SE<lt>E<gt>
+
+This is S<some whitespace>.
+
+[output]
+Test of S<>
+ This is some whitespace.
diff --git a/cpan/podlators/t/data/snippets/text/sentence-spacing b/cpan/podlators/t/data/snippets/text/sentence-spacing
new file mode 100644
index 0000000000..bce8c813c8
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/sentence-spacing
@@ -0,0 +1,18 @@
+[name]
+Spacing with sentence option
+
+[options]
+sentence 1
+
+[input]
+=head1 EXAMPLE
+
+Whitespace around C<< this. >> must be ignored per perlpodspec. >>
+needs to eat all of the space in front of it.
+
+=cut
+
+[output]
+EXAMPLE
+ Whitespace around "this." must be ignored per perlpodspec. >> needs to
+ eat all of the space in front of it.
diff --git a/cpan/podlators/t/data/snippets/text/utf8 b/cpan/podlators/t/data/snippets/text/utf8
new file mode 100644
index 0000000000..8231a2abd9
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/utf8
@@ -0,0 +1,38 @@
+[name]
+UTF-8 text
+
+[input]
+=encoding utf-8
+
+=head1 I can eat glass
+
+=over 4
+
+=item Esperanto
+
+Mi povas manĝi vitron, ĝi ne damaĝas min.
+
+=item Braille
+
+⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑
+
+=item Hindi
+
+मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती.
+
+=back
+
+See L<http://www.columbia.edu/kermit/utf8.html>
+
+[output]
+I can eat glass
+ Esperanto
+ Mi povas manĝi vitron, ĝi ne damaĝas min.
+
+ Braille
+ ⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑
+
+ Hindi
+ मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती.
+
+ See <http://www.columbia.edu/kermit/utf8.html>
diff --git a/cpan/podlators/t/data/snippets/text/verbatim b/cpan/podlators/t/data/snippets/text/verbatim
new file mode 100644
index 0000000000..689a60f94d
--- /dev/null
+++ b/cpan/podlators/t/data/snippets/text/verbatim
@@ -0,0 +1,18 @@
+[name]
+Verbatim text
+
+[input]
+=pod
+
+text
+
+ line1
+
+ line3
+
+[output]
+ text
+
+ line1
+
+ line3
diff --git a/cpan/podlators/t/data/termcap b/cpan/podlators/t/data/termcap
index 80948156ca..32346dd08d 100644
--- a/cpan/podlators/t/data/termcap
+++ b/cpan/podlators/t/data/termcap
@@ -6,3 +6,4 @@
# provide this file anyway to ensure the test suite will still run.
xterm:co=#80:do=^J:md=\E[1m:us=\E[4m:me=\E[m
+unknown:co=#80:do=^J
diff --git a/cpan/podlators/t/docs/pod-spelling.t b/cpan/podlators/t/docs/pod-spelling.t
index 94d75035bc..819aa69331 100644
--- a/cpan/podlators/t/docs/pod-spelling.t
+++ b/cpan/podlators/t/docs/pod-spelling.t
@@ -6,6 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2019 Russ Allbery <eagle@eyrie.org>
# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
@@ -29,15 +30,16 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
use Test::RRA qw(skip_unless_author use_prereq);
+use Test::More;
+
# Only run this test for the module author since the required stopwords are
# too sensitive to the exact spell-checking program and dictionary.
skip_unless_author('Spelling tests');
diff --git a/cpan/podlators/t/docs/pod.t b/cpan/podlators/t/docs/pod.t
index 5fcfcdf77c..e7d0231660 100644
--- a/cpan/podlators/t/docs/pod.t
+++ b/cpan/podlators/t/docs/pod.t
@@ -6,6 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2019 Russ Allbery <eagle@eyrie.org>
# Copyright 2012-2014
# The Board of Trustees of the Leland Stanford Junior University
#
@@ -29,15 +30,16 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
use Test::RRA qw(skip_unless_automated use_prereq);
+use Test::More;
+
# Skip this test for normal user installs, although pod2man may still fail.
skip_unless_automated('POD syntax tests');
diff --git a/cpan/podlators/t/docs/spdx-license.t b/cpan/podlators/t/docs/spdx-license.t
index 100adf11ee..5b34cab493 100644
--- a/cpan/podlators/t/docs/spdx-license.t
+++ b/cpan/podlators/t/docs/spdx-license.t
@@ -9,7 +9,7 @@
# 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>
+# Copyright 2018-2019 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"),
@@ -31,21 +31,22 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
+use Test::RRA qw(skip_unless_automated);
+
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 Build ( [.] (?!PL) .* )? \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
@@ -60,11 +61,13 @@ my @IGNORE_PATHS = (
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 [.] /debian/ }xms, # Found in debian/* branches
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
+ qr{ \A [.] /t/data .* [.] json \z }xms, # Test metadata
);
## use critic
@@ -81,9 +84,7 @@ 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.
+ # Ignore files in the whitelist and binary files.
for my $pattern (@IGNORE) {
return if $filename =~ $pattern;
}
@@ -95,12 +96,14 @@ sub check_file {
}
return if -d $filename;
return if !-T $filename;
- return if -s $filename < 1024;
# Scan the file.
- my ($saw_spdx, $skip_spdx);
+ my ($saw_legacy_notice, $saw_spdx, $skip_spdx);
open(my $file, '<', $filename) or BAIL_OUT("Cannot open $path");
while (defined(my $line = <$file>)) {
+ if ($line =~ m{ \b See \s+ LICENSE \s+ for \s+ licensing }xms) {
+ $saw_legacy_notice = 1;
+ }
if ($line =~ m{ \b SPDX-License-Identifier: \s+ \S+ }xms) {
$saw_spdx = 1;
last;
@@ -111,7 +114,16 @@ sub check_file {
}
}
close($file) or BAIL_OUT("Cannot close $path");
- ok($saw_spdx || $skip_spdx, $path);
+
+ # If there is a legacy license notice, report a failure regardless of file
+ # size. Otherwise, skip files under 1KB. They can be rolled up into the
+ # overall project license and the license notice may be a substantial
+ # portion of the file size.
+ if ($saw_legacy_notice) {
+ ok(!$saw_legacy_notice, "$path has legacy license notice");
+ } else {
+ ok($saw_spdx || $skip_spdx || -s $filename < 1024, $path);
+ }
return;
}
diff --git a/cpan/podlators/t/docs/synopsis.t b/cpan/podlators/t/docs/synopsis.t
index 43a8354ba4..1a2fbf1af2 100644
--- a/cpan/podlators/t/docs/synopsis.t
+++ b/cpan/podlators/t/docs/synopsis.t
@@ -6,6 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2019 Russ Allbery <eagle@eyrie.org>
# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
@@ -29,15 +30,16 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
+use Test::RRA qw(skip_unless_automated use_prereq);
+
use File::Spec;
use Test::More;
-use Test::RRA qw(skip_unless_automated use_prereq);
# Skip for normal user installs since this doesn't affect functionality.
skip_unless_automated('Synopsis syntax tests');
diff --git a/cpan/podlators/t/general/basic.t b/cpan/podlators/t/general/basic.t
index 717e3762df..d4978bcf36 100644
--- a/cpan/podlators/t/general/basic.t
+++ b/cpan/podlators/t/general/basic.t
@@ -12,7 +12,7 @@
# 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, 2018
+# Copyright 2001-2002, 2004, 2006, 2009, 2012, 2014-2015, 2018-2019
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
@@ -20,7 +20,7 @@
#
# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
-use 5.006;
+use 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/general/filehandle.t b/cpan/podlators/t/general/filehandle.t
index 42601a0587..3c5d753a48 100644
--- a/cpan/podlators/t/general/filehandle.t
+++ b/cpan/podlators/t/general/filehandle.t
@@ -6,14 +6,14 @@
# Pod::Man and Pod::Text had to implement it directly. Test to be sure it's
# working properly.
#
-# Copyright 2006, 2009, 2012, 2014-2016, 2018 Russ Allbery <rra@cpan.org>
+# Copyright 2006, 2009, 2012, 2014-2016, 2018-2019 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 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/general/pod-parser.t b/cpan/podlators/t/general/pod-parser.t
index 9c51aff87a..c008499298 100644
--- a/cpan/podlators/t/general/pod-parser.t
+++ b/cpan/podlators/t/general/pod-parser.t
@@ -2,14 +2,14 @@
#
# Tests for backward compatibility with Pod::Parser.
#
-# Copyright 2006, 2008-2009, 2012, 2015, 2018 by Russ Allbery <rra@cpan.org>
+# Copyright 2006, 2008-2009, 2012, 2015, 2018-2019 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 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/lib/Test/Podlators.pm b/cpan/podlators/t/lib/Test/Podlators.pm
index 3ae940924e..a7e099daf8 100644
--- a/cpan/podlators/t/lib/Test/Podlators.pm
+++ b/cpan/podlators/t/lib/Test/Podlators.pm
@@ -8,7 +8,7 @@
package Test::Podlators;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -278,8 +278,8 @@ sub test_snippet {
# Check the output, errors, and any exception.
is($got, $data_ref->{output}, "$data_ref->{name}: output");
- if ($data_ref->{errors}) {
- is($stderr, $data_ref->{errors}, "$data_ref->{name}: errors");
+ if ($data_ref->{errors} || $stderr) {
+ is($stderr, $data_ref->{errors} || q{}, "$data_ref->{name}: errors");
}
if ($data_ref->{exception} || $exception) {
if ($exception) {
@@ -509,7 +509,7 @@ Russ Allbery <rra@cpan.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2015, 2016, 2018 Russ Allbery <rra@cpan.org>
+Copyright 2015-2016, 2018-2019 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.
diff --git a/cpan/podlators/t/lib/Test/RRA.pm b/cpan/podlators/t/lib/Test/RRA.pm
index cbfdc42603..1d5e4db23d 100644
--- a/cpan/podlators/t/lib/Test/RRA.pm
+++ b/cpan/podlators/t/lib/Test/RRA.pm
@@ -10,25 +10,41 @@
package Test::RRA;
-use 5.006;
+use 5.008;
+use base qw(Exporter);
use strict;
use warnings;
-use Exporter;
+use Carp qw(croak);
use File::Temp;
-use Test::More;
-# For Perl 5.006 compatibility.
-## no critic (ClassHierarchies::ProhibitExplicitISA)
+# Abort if Test::More was loaded before Test::RRA to be sure that we get the
+# benefits of the Test::More probing below.
+if ($INC{'Test/More.pm'}) {
+ croak('Test::More loaded before Test::RRA');
+}
+
+# Red Hat's base perl package doesn't include Test::More (one has to install
+# the perl-core package in addition). Try to detect this and skip any Perl
+# tests if Test::More is not present. This relies on Test::RRA being included
+# before Test::More.
+eval {
+ require Test::More;
+ Test::More->import();
+};
+if ($@) {
+ print "1..0 # SKIP Test::More required for test\n"
+ or croak('Cannot write to stdout');
+ exit 0;
+}
# Declare variables that should be set in BEGIN for robustness.
-our (@EXPORT_OK, @ISA, $VERSION);
+our (@EXPORT_OK, $VERSION);
# Set $VERSION and everything export-related in a BEGIN block for robustness
# against circular module loading (not that we load any modules, but
# consistency is good).
BEGIN {
- @ISA = qw(Exporter);
@EXPORT_OK = qw(
is_file_contents skip_unless_author skip_unless_automated use_prereq
);
@@ -36,7 +52,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 = '7.01';
+ $VERSION = '8.01';
}
# Compare a string to the contents of a file, similar to the standard is()
@@ -61,22 +77,27 @@ sub is_file_contents {
return;
}
- # Otherwise, we show a diff, but only if we have IPC::System::Simple.
- eval { require IPC::System::Simple };
+ # Otherwise, we show a diff, but only if we have IPC::System::Simple and
+ # diff succeeds. Otherwise, we fall back on showing the full expected and
+ # seen output.
+ eval {
+ require IPC::System::Simple;
+
+ my $tmp = File::Temp->new();
+ my $tmpname = $tmp->filename;
+ print {$tmp} $got or BAIL_OUT("Cannot write to $tmpname: $!\n");
+ my @command = ('diff', '-u', $expected, $tmpname);
+ my $diff = IPC::System::Simple::capturex([0 .. 1], @command);
+ diag($diff);
+ };
if ($@) {
- ok(0, $message);
- return;
+ diag('Expected:');
+ diag($expected);
+ diag('Seen:');
+ diag($data);
}
- # They're not equal. Write out what we got so that we can run diff.
- my $tmp = File::Temp->new();
- my $tmpname = $tmp->filename;
- print {$tmp} $got or BAIL_OUT("Cannot write to $tmpname: $!\n");
- my @command = ('diff', '-u', $expected, $tmpname);
- my $diff = IPC::System::Simple::capturex([0 .. 1], @command);
- diag($diff);
-
- # Remove the temporary file and report failure.
+ # Report failure.
ok(0, $message);
return;
}
@@ -91,7 +112,7 @@ sub is_file_contents {
sub skip_unless_author {
my ($description) = @_;
if (!$ENV{AUTHOR_TESTING}) {
- plan skip_all => "$description only run for author";
+ plan(skip_all => "$description only run for author");
}
return;
}
@@ -110,7 +131,7 @@ sub skip_unless_automated {
for my $env (qw(AUTOMATED_TESTING RELEASE_TESTING AUTHOR_TESTING)) {
return if $ENV{$env};
}
- plan skip_all => "$description normally skipped";
+ plan(skip_all => "$description normally skipped");
return;
}
@@ -152,14 +173,14 @@ sub use_prereq {
use $module $version \@imports;
1;
};
- $error = $@;
+ $error = $@;
$sigdie = $SIG{__DIE__} || undef;
}
# If the use failed for any reason, skip the test.
if (!$result || $error) {
my $name = length($version) > 0 ? "$module $version" : $module;
- plan skip_all => "$name required for test";
+ plan(skip_all => "$name required for test");
}
# If the module set $SIG{__DIE__}, we cleared that via local. Restore it.
@@ -202,6 +223,14 @@ This module collects utility functions that are useful for Perl test scripts.
It assumes Russ Allbery's Perl module layout and test conventions and will
only be useful for other people if they use the same conventions.
+This module B<must> be loaded before Test::More or it will abort during
+import. It will skip the test (by printing a skip message to standard output
+and exiting with status 0, equivalent to C<plan skip_all>) during import if
+Test::More is not available. This allows tests written in Perl using this
+module to be skipped if run on a system with Perl but not Test::More, such as
+Red Hat systems with the C<perl> package but not the C<perl-core> package
+installed.
+
=head1 FUNCTIONS
None of these functions are imported by default. The ones used by a script
@@ -246,7 +275,9 @@ Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2013, 2014 The Board of Trustees of the Leland Stanford Junior
+Copyright 2016, 2018-2019 Russ Allbery <eagle@eyrie.org>
+
+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
diff --git a/cpan/podlators/t/lib/Test/RRA/Config.pm b/cpan/podlators/t/lib/Test/RRA/Config.pm
index b2f94466dd..80a1573941 100644
--- a/cpan/podlators/t/lib/Test/RRA/Config.pm
+++ b/cpan/podlators/t/lib/Test/RRA/Config.pm
@@ -9,24 +9,20 @@
package Test::RRA::Config;
-use 5.006;
+use 5.008;
+use base qw(Exporter);
use strict;
use warnings;
-# For Perl 5.006 compatibility.
-## no critic (ClassHierarchies::ProhibitExplicitISA)
-
-use Exporter;
use Test::More;
# Declare variables that should be set in BEGIN for robustness.
-our (@EXPORT_OK, @ISA, $VERSION);
+our (@EXPORT_OK, $VERSION);
# Set $VERSION and everything export-related in a BEGIN block for robustness
# against circular module loading (not that we load any modules, but
# consistency is good).
BEGIN {
- @ISA = qw(Exporter);
@EXPORT_OK = qw(
$COVERAGE_LEVEL @COVERAGE_SKIP_TESTS @CRITIC_IGNORE $LIBRARY_PATH
$MINIMUM_VERSION %MINIMUM_VERSION @MODULE_VERSION_IGNORE
@@ -36,7 +32,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 = '7.01';
+ $VERSION = '8.01';
}
# If C_TAP_BUILD or C_TAP_SOURCE are set in the environment, look for
@@ -187,9 +183,9 @@ Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2015, 2016 Russ Allbery <eagle@eyrie.org>
+Copyright 2015-2016, 2019 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
diff --git a/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm b/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
index 3b3d6742df..fc8bfbc8de 100644
--- a/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
+++ b/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
@@ -8,32 +8,28 @@
package Test::RRA::ModuleVersion;
-use 5.006;
+use 5.008;
+use base qw(Exporter);
use strict;
use warnings;
-use Exporter;
use File::Find qw(find);
use Test::More;
use Test::RRA::Config qw(@MODULE_VERSION_IGNORE);
-# For Perl 5.006 compatibility.
-## no critic (ClassHierarchies::ProhibitExplicitISA)
-
# Declare variables that should be set in BEGIN for robustness.
-our (@EXPORT_OK, @ISA, $VERSION);
+our (@EXPORT_OK, $VERSION);
# Set $VERSION and everything export-related in a BEGIN block for robustness
# against circular module loading (not that we load any modules, but
# consistency is good).
BEGIN {
- @ISA = qw(Exporter);
@EXPORT_OK = qw(test_module_versions update_module_versions);
# 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 = '7.01';
+ $VERSION = '8.01';
}
# A regular expression matching the version string for a module using the
@@ -129,21 +125,23 @@ sub _module_version {
# Throws: Text exception on I/O failure or inability to find version
sub _update_module_version {
my ($file, $version) = @_;
- open(my $in, q{<}, $file) or die "$0: cannot open $file: $!\n";
- open(my $out, q{>}, "$file.new")
- or die "$0: cannot create $file.new: $!\n";
- # If the version starts with v, use it without quotes. Otherwise, quote
- # it to prevent removal of trailing zeroes.
- if ($version !~ m{ \A v }xms) {
- $version = "'$version'";
+ # The old-style syntax may require different quoting. If the version
+ # starts with v, use it without quotes. Otherwise, quote it to prevent
+ # removal of trailing zeroes.
+ my $old_version = $version;
+ if ($old_version !~ m{ \A v }xms) {
+ $old_version = "'$old_version'";
}
# Scan for the version and replace it.
+ open(my $in, q{<}, $file) or die "$0: cannot open $file: $!\n";
+ open(my $out, q{>}, "$file.new")
+ or die "$0: cannot create $file.new: $!\n";
SCAN:
while (defined(my $line = <$in>)) {
if ( $line =~ s{ $REGEX_VERSION_PACKAGE }{$1$version$3}xms
- || $line =~ s{ $REGEX_VERSION_OLD }{$1$version$3}xms)
+ || $line =~ s{ $REGEX_VERSION_OLD }{$1$old_version$3}xms)
{
print {$out} $line or die "$0: cannot write to $file.new: $!\n";
last SCAN;
@@ -153,8 +151,8 @@ sub _update_module_version {
# Copy the rest of the input file to the output file.
print {$out} <$in> or die "$0: cannot write to $file.new: $!\n";
- close($out) or die "$0: cannot flush $file.new: $!\n";
- close($in) or die "$0: error reading from $file: $!\n";
+ close($out) or die "$0: cannot flush $file.new: $!\n";
+ close($in) or die "$0: error reading from $file: $!\n";
# All done. Rename the new file over top of the old file.
rename("$file.new", $file)
@@ -267,7 +265,7 @@ Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2016 Russ Allbery <eagle@eyrie.org>
+Copyright 2016, 2018-2019 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
diff --git a/cpan/podlators/t/man/devise-date.t b/cpan/podlators/t/man/devise-date.t
index 129721323c..4729e0bf0f 100644
--- a/cpan/podlators/t/man/devise-date.t
+++ b/cpan/podlators/t/man/devise-date.t
@@ -3,16 +3,16 @@
# In order for MakeMaker to build in the core, nothing can use Fcntl which
# includes POSIX. devise_date()'s use of strftime() was replaced. This tests
# that it's identical. It also tests special handling of the POD_MAN_DATE
-# environment variable.
+# and SOURCE_DATE_EPOCH environment variables.
#
-# Copyright 2009, 2014-2015, 2018 Russ Allbery <rra@cpan.org>
+# Copyright 2009, 2014-2015, 2018-2019 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 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/man/devise-title.t b/cpan/podlators/t/man/devise-title.t
index a7e5e7b89d..b2e82468b4 100644
--- a/cpan/podlators/t/man/devise-title.t
+++ b/cpan/podlators/t/man/devise-title.t
@@ -3,14 +3,14 @@
# 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, 2018 Russ Allbery <rra@cpan.org>
+# Copyright 2015-2016, 2018-2019 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 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/man/empty.t b/cpan/podlators/t/man/empty.t
index 4924fc8466..cd0cfccc37 100644
--- a/cpan/podlators/t/man/empty.t
+++ b/cpan/podlators/t/man/empty.t
@@ -2,14 +2,14 @@
#
# Test Pod::Man with a document that produces only errors.
#
-# Copyright 2013, 2016, 2018 Russ Allbery <rra@cpan.org>
+# Copyright 2013, 2016, 2018-2019 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 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/man/heading.t b/cpan/podlators/t/man/heading.t
index 9691446b6f..f8964025e3 100644
--- a/cpan/podlators/t/man/heading.t
+++ b/cpan/podlators/t/man/heading.t
@@ -2,7 +2,7 @@
#
# Additional tests for Pod::Man heading generation.
#
-# Copyright 2002, 2004, 2006, 2008-2009, 2012, 2015, 2018
+# Copyright 2002, 2004, 2006, 2008-2009, 2012, 2015, 2018-2019
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
@@ -10,7 +10,7 @@
#
# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
-use 5.006;
+use 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/man/iso-8859-1.t b/cpan/podlators/t/man/iso-8859-1.t
index 0c1dac38be..da23190d16 100644
--- a/cpan/podlators/t/man/iso-8859-1.t
+++ b/cpan/podlators/t/man/iso-8859-1.t
@@ -2,12 +2,14 @@
#
# Test Pod::Man ISO-8859-1 handling
#
-# Copyright 2016 Russ Allbery <rra@cpan.org>
+# Copyright 2016, 2019 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 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/man/no-encode.t b/cpan/podlators/t/man/no-encode.t
index ca2dc86e2b..199016217d 100644
--- a/cpan/podlators/t/man/no-encode.t
+++ b/cpan/podlators/t/man/no-encode.t
@@ -10,21 +10,18 @@
#
# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
-use 5.006;
+use 5.008;
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 5;
-# Force the Encode module to be impossible to import. Sometimes Encode is
-# already loaded before the test suite runs (this seems common for CPAN
-# Testers tests for some reason), so skip the test if that's the case.
+# Remove the record of the Encode module being loaded if it already was (it
+# may have been loaded before the test suite runs), and then make it
+# impossible to load it. This should be enough to trigger the fallback code
+# in Pod::Man.
BEGIN {
- if ($INC{'Encode.pm'}) {
- plan skip_all => 'Encode is already loaded';
- } else {
- plan tests => 5;
- }
+ delete $INC{'Encode.pm'};
my $reject_encode = sub {
if ($_[1] eq 'Encode.pm') {
die "refusing to load Encode\n";
diff --git a/cpan/podlators/t/man/snippets.t b/cpan/podlators/t/man/snippets.t
index 159887199a..7e0ad3808f 100644
--- a/cpan/podlators/t/man/snippets.t
+++ b/cpan/podlators/t/man/snippets.t
@@ -2,7 +2,7 @@
#
# Test Pod::Man behavior with various snippets.
#
-# Copyright 2002, 2004, 2006, 2008-2009, 2012-2013, 2015-2016, 2018
+# Copyright 2002, 2004, 2006, 2008-2009, 2012-2013, 2015-2016, 2018-2019
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
@@ -10,7 +10,7 @@
#
# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
-use 5.006;
+use 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/man/utf8-io.t b/cpan/podlators/t/man/utf8-io.t
index d1c950076b..58369310ce 100644
--- a/cpan/podlators/t/man/utf8-io.t
+++ b/cpan/podlators/t/man/utf8-io.t
@@ -2,7 +2,7 @@
#
# Test Pod::Man UTF-8 handling, with and without PerlIO.
#
-# Copyright 2002, 2004, 2006, 2008-2010, 2012, 2014-2015, 2018
+# Copyright 2002, 2004, 2006, 2008-2010, 2012, 2014-2015, 2018-2019
# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
@@ -10,24 +10,15 @@
#
# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 13;
use Test::Podlators qw(test_snippet_with_io);
-# UTF-8 support requires Perl 5.8 or later.
-BEGIN {
- if ($] < 5.008) {
- plan skip_all => 'Perl 5.8 required for UTF-8 support';
- } else {
- plan tests => 13;
- }
-}
-
# Load the module.
BEGIN {
use_ok('Pod::Man');
diff --git a/cpan/podlators/t/style/minimum-version.t b/cpan/podlators/t/style/minimum-version.t
index 7698c2babf..861367de4a 100644
--- a/cpan/podlators/t/style/minimum-version.t
+++ b/cpan/podlators/t/style/minimum-version.t
@@ -6,6 +6,7 @@
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2019 Russ Allbery <eagle@eyrie.org>
# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
@@ -29,16 +30,17 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
use Test::RRA qw(skip_unless_automated use_prereq);
use Test::RRA::Config qw($MINIMUM_VERSION);
+use Test::More;
+
# Skip for normal user installs since this doesn't affect functionality.
skip_unless_automated('Minimum version tests');
diff --git a/cpan/podlators/t/style/module-version.t b/cpan/podlators/t/style/module-version.t
index 80368cb02e..035b596de5 100644
--- a/cpan/podlators/t/style/module-version.t
+++ b/cpan/podlators/t/style/module-version.t
@@ -11,16 +11,17 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
-use Getopt::Long qw(GetOptions);
use Test::RRA qw(skip_unless_automated use_prereq);
use Test::RRA::ModuleVersion qw(test_module_versions update_module_versions);
+use Getopt::Long qw(GetOptions);
+
# If we have options, we're being run from the command line and always load
# our prerequisite modules. Otherwise, check if we have necessary
# prerequisites and should run as a test suite.
@@ -120,7 +121,7 @@ Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2014-2016 Russ Allbery <eagle@eyrie.org>
+Copyright 2014-2016, 2019 Russ Allbery <eagle@eyrie.org>
Copyright 2013-2014 The Board of Trustees of the Leland Stanford Junior
University
diff --git a/cpan/podlators/t/docs/urls.t b/cpan/podlators/t/style/obsolete-strings.t
index a654c5453c..fca5a80f30 100644
--- a/cpan/podlators/t/docs/urls.t
+++ b/cpan/podlators/t/style/obsolete-strings.t
@@ -1,15 +1,15 @@
#!/usr/bin/perl
#
-# Check URLs in source files.
+# Check for obsolete strings 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.
+# Examine all source files in a distribution for obsolete strings and report
+# on files that fail this check. This catches various transitions I want to
+# do globally in all my packages, like changing my personal URLs to 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>
+# Copyright 2016, 2018-2019 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"),
@@ -31,41 +31,42 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
+use Test::RRA qw(skip_unless_automated);
+
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);
+my @BAD_STRINGS = qw(rra@stanford.edu RRA_MAINTAINER_TESTS);
# File or directory names to always skip.
-my %SKIP = map { $_ => 1 } qw(.git _build blib cover_db);
+my %SKIP = map { $_ => 1 } qw(
+ .git Changes _build blib cover_db obsolete-strings.t
+);
# 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');
+skip_unless_automated('Obsolete strings 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.
+ # Ignore and prune any skipped files. Ignore directories and binaries.
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");
diff --git a/cpan/podlators/t/style/strict.t b/cpan/podlators/t/style/strict.t
index a3d2a3e942..a87c1fabca 100644
--- a/cpan/podlators/t/style/strict.t
+++ b/cpan/podlators/t/style/strict.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 2016 Russ Allbery <eagle@eyrie.org>
+# Copyright 2016, 2018-2019 Russ Allbery <eagle@eyrie.org>
# Copyright 2013-2014
# The Board of Trustees of the Leland Stanford Junior University
#
@@ -30,15 +30,16 @@
#
# SPDX-License-Identifier: MIT
-use 5.006;
+use 5.008;
use strict;
use warnings;
use lib 't/lib';
-use File::Spec;
use Test::RRA qw(skip_unless_automated use_prereq);
+use File::Spec;
+
# Skip for normal user installs since this doesn't affect functionality.
skip_unless_automated('Strictness tests');
@@ -46,15 +47,40 @@ skip_unless_automated('Strictness tests');
# use 5.012 or later automatically implies use strict.
use_prereq('Test::Strict', '0.25');
-# Test everything in the distribution directory except the Build and
-# Makefile.PL scripts generated by Module::Build. We also want to check use
-# warnings.
-$Test::Strict::TEST_SKIP = ['Build', 'Makefile.PL'];
+# Directories to exclude from checks.
+my %EXCLUDE = map { $_ => 1 } qw(.git blib);
+
+# Determine whether we want to check the given file or top-level directory.
+# Assume that the only interesting files at the top level are directories or
+# files ending in *.PL.
+#
+# $file - Name of the file or directory
+#
+# Returns: 1 if it should be checked, undef otherwise.
+sub should_check {
+ my ($file) = @_;
+ return if $EXCLUDE{$file};
+ return 1 if -d $file;
+ return 1 if $file =~ m{ [.] PL \z }xms;
+ return;
+}
+
+# Test::Strict (as of 0.47) doesn't have a way of excluding whole directories
+# from all_perl_files_ok and doesn't exclude .git, which results in false
+# positives if there are Perl files unpacked under .git (which is often the
+# case when using dgit). We therefore can't just point it at the root of the
+# module distribution and instead have to manually construct a list of
+# interesting files.
+opendir(my $rootdir, File::Spec->curdir)
+ or die "$0: cannot open current directory: $!\n";
+my @files = File::Spec->no_upwards(readdir($rootdir));
+closedir($rootdir) or die "$0: cannot close current directory: $!\n";
+my @to_check = grep { should_check($_) } @files;
+
+# Test the files and top-level directories we found, including checking for
+# use warnings.
$Test::Strict::TEST_WARNINGS = 1;
-all_perl_files_ok(File::Spec->curdir);
+all_perl_files_ok(@to_check);
# Hack to suppress "used only once" warnings.
-END {
- $Test::Strict::TEST_SKIP = [];
- $Test::Strict::TEST_WARNINGS = 0;
-}
+END { $Test::Strict::TEST_WARNINGS = 0 }
diff --git a/cpan/podlators/t/text/basic.t b/cpan/podlators/t/text/basic.t
deleted file mode 100644
index 024cc0e0e7..0000000000
--- a/cpan/podlators/t/text/basic.t
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Additional specialized tests for Pod::Text.
-#
-# 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';
- if ($ENV{PERL_CORE}) {
- @INC = '../lib';
- }
- unshift (@INC, '../blib/lib');
- $| = 1;
-}
-
-use strict;
-
-use Pod::Simple;
-use Test::More tests => 9;
-BEGIN { use_ok ('Pod::Text') }
-
-my $parser = Pod::Text->new;
-isa_ok ($parser, 'Pod::Text', '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++;
-}
-
-# Below the marker are bits of POD and corresponding expected text output.
-# This is used to test specific features or problems with Pod::Text. The
-# input and output are separated by lines containing only ###.
-
-__DATA__
-
-###
-=head1 PERIODS
-
-This C<.> should be quoted.
-###
-PERIODS
- This "." should be quoted.
-
-###
-
-###
-=head1 CE<lt>E<gt> WITH SPACES
-
-What does C<< this. >> end up looking like?
-###
-C<> WITH SPACES
- What does "this." end up looking like?
-
-###
-
-###
-=head1 Test of SE<lt>E<gt>
-
-This is some S< > whitespace.
-###
-Test of S<>
- This is some whitespace.
-
-###
-
-###
-=head1 Test of =for
-
-=for comment
-This won't be seen.
-
-Yes.
-
-=for text
-This should be seen.
-
-=for TEXT As should this.
-
-=for man
-But this shouldn't.
-
-Some more text.
-###
-Test of =for
- Yes.
-
-This should be seen.
-As should this.
- Some more text.
-
-###
-
-###
-=pod
-
-text
-
- line1
-
- line3
-###
- text
-
- line1
-
- line3
-
-###
-
-###
-=head1 LINK TO URL
-
-This is a L<link|http://www.example.com/> to a URL.
-###
-LINK TO URL
- This is a link <http://www.example.com/> to a URL.
-
-###
-
-###
-=head1 RT LINK
-
-L<[perl #12345]|https://rt.cpan.org/12345>
-###
-RT LINK
- [perl #12345] <https://rt.cpan.org/12345>
-
-###
diff --git a/cpan/podlators/t/text/color.t b/cpan/podlators/t/text/color.t
index b7edd48a27..aa75beeb05 100644
--- a/cpan/podlators/t/text/color.t
+++ b/cpan/podlators/t/text/color.t
@@ -2,13 +2,13 @@
#
# Test Pod::Text::Color behavior with various snippets.
#
-# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018
+# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018-2019
# 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.
-use 5.006;
+use 5.008;
use strict;
use warnings;
diff --git a/cpan/podlators/t/text/encoding.t b/cpan/podlators/t/text/encoding.t
deleted file mode 100644
index 7a6b6f2801..0000000000
--- a/cpan/podlators/t/text/encoding.t
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Test Pod::Text with various weird encoding combinations.
-#
-# 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';
- if ($ENV{PERL_CORE}) {
- @INC = '../lib';
- }
- unshift (@INC, '../blib/lib');
- $| = 1;
-}
-
-use strict;
-
-use Test::More;
-
-# UTF-8 support requires Perl 5.8 or later.
-BEGIN {
- if ($] < 5.008) {
- plan skip_all => 'Perl 5.8 required for encoding support';
- } else {
- plan tests => 7;
- }
-}
-BEGIN { use_ok ('Pod::Text') }
-
-eval { binmode (\*DATA, ':raw') };
-eval { binmode (\*STDOUT, ':raw') };
-my $builder = Test::More->builder;
-eval { binmode ($builder->output, ':raw') };
-eval { binmode ($builder->failure_output, ':raw') };
-
-my $n = 1;
-while (<DATA>) {
- my %opts;
- next until $_ eq "###\n";
- my $parser = Pod::Text->new (%opts);
- isa_ok ($parser, 'Pod::Text', 'Parser object');
- open (TMP, "> tmp$$.pod") or die "Cannot create tmp$$.pod: $!\n";
- eval { binmode (\*TMP, ':raw') };
- while (<DATA>) {
- last if $_ eq "###\n";
- print TMP $_;
- }
- close TMP;
- open (OUT, "> out$$.tmp") or die "Cannot create out$$.tmp: $!\n";
- eval { binmode (\*OUT, ':raw') };
- $parser->parse_from_file ("tmp$$.pod", \*OUT);
- close OUT;
- open (TMP, "out$$.tmp") or die "Cannot open out$$.tmp: $!\n";
- eval { binmode (\*TMP, ':raw') };
- 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 text output.
-# This is used to test specific features or problems with Pod::Text. The
-# input and output are separated by lines containing only ###.
-
-__DATA__
-
-###
-=head1 Test of SE<lt>E<gt>
-
-This is S<some whitespace>.
-###
-Test of S<>
- This is some whitespace.
-
-###
-
-###
-=encoding utf-8
-
-=head1 I can eat glass
-
-=over 4
-
-=item Esperanto
-
-Mi povas manĝi vitron, ĝi ne damaĝas min.
-
-=item Braille
-
-⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑
-
-=item Hindi
-
-मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती.
-
-=back
-
-See L<http://www.columbia.edu/kermit/utf8.html>
-###
-I can eat glass
- Esperanto
- Mi povas manĝi vitron, ĝi ne damaĝas min.
-
- Braille
- ⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞â
- €â ™â •â ‘⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑
-
- Hindi
- मैं काँच खा सकता हूँ और
- मुझे उससे कोई चोट नहीं
- पहुंचती.
-
- See <http://www.columbia.edu/kermit/utf8.html>
-
-###
-
-###
-=pod
-
-=head1 NAME
-
-This is the first ascii text
-
-=encoding utf8
-
-=over 4
-
-=item ⇒This is the first non-ascii text⇐
-
-This is the second ascii text
-
-=back
-
-=cut
-###
-NAME
- This is the first ascii text
-
- ⇒This is the first non-ascii text⇐
- This is the second ascii text
-
-###
diff --git a/cpan/podlators/t/text/options.t b/cpan/podlators/t/text/options.t
deleted file mode 100644
index d191cf00f9..0000000000
--- a/cpan/podlators/t/text/options.t
+++ /dev/null
@@ -1,368 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Additional tests for Pod::Text options.
-#
-# 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';
- if ($ENV{PERL_CORE}) {
- @INC = '../lib';
- }
- unshift (@INC, '../blib/lib');
- $| = 1;
-}
-
-use strict;
-
-use Test::More tests => 37;
-BEGIN { use_ok ('Pod::Text') }
-
-# Redirect stderr to a file.
-sub stderr_save {
- open (OLDERR, '>&STDERR') or die "Can't dup STDERR: $!\n";
- open (STDERR, "> out$$.err") or die "Can't redirect STDERR: $!\n";
-}
-
-# Restore stderr.
-sub stderr_restore {
- close STDERR;
- open (STDERR, '>&OLDERR') or die "Can't dup STDERR: $!\n";
- close OLDERR;
-}
-
-my $n = 1;
-while (<DATA>) {
- my %options;
- next until $_ eq "###\n";
- while (<DATA>) {
- last if $_ eq "###\n";
- my ($option, $value) = split;
- $options{$option} = $value;
- }
- open (TMP, "> tmp$$.pod") or die "Cannot create tmp$$.pod: $!\n";
- while (<DATA>) {
- last if $_ eq "###\n";
- print TMP $_;
- }
- close TMP;
- my $parser = Pod::Text->new (%options);
- isa_ok ($parser, 'Pod::Text', 'Parser object');
- open (OUT, "> out$$.tmp") or die "Cannot create out$$.tmp: $!\n";
- stderr_save;
- 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";
- 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");
- open (ERR, "out$$.err") or die "Cannot open out$$.err: $!\n";
- my $errors;
- {
- local $/;
- $errors = <ERR>;
- }
- 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";
- $expected .= $_;
- }
- is ($errors, $expected, "Errors correct for test $n");
- $n++;
-}
-
-# Below the marker are bits of POD and corresponding expected text output.
-# This is used to test specific features or problems with Pod::Text. The
-# options, input, output, and errors are separated by lines containing only
-# ###.
-
-__DATA__
-
-###
-alt 1
-###
-=head1 SAMPLE
-
-=over 4
-
-=item F
-
-Paragraph.
-
-=item Bar
-
-=item B
-
-Paragraph.
-
-=item Longer
-
-Paragraph.
-
-=back
-
-###
-
-==== SAMPLE ====
-
-: F Paragraph.
-
-: Bar
-: B Paragraph.
-
-: Longer
- Paragraph.
-
-###
-###
-
-###
-margin 4
-###
-=head1 SAMPLE
-
-This is some body text that is long enough to be a paragraph that wraps,
-thereby testing margins with wrapped paragraphs.
-
- This is some verbatim text.
-
-=over 6
-
-=item Test
-
-This is a test of an indented paragraph.
-
-This is another indented paragraph.
-
-=back
-###
- SAMPLE
- This is some body text that is long enough to be a paragraph that
- wraps, thereby testing margins with wrapped paragraphs.
-
- This is some verbatim text.
-
- Test This is a test of an indented paragraph.
-
- This is another indented paragraph.
-
-###
-###
-
-###
-code 1
-###
-This is some random text.
-This is more random text.
-
-This is some random text.
-This is more random text.
-
-=head1 SAMPLE
-
-This is POD.
-
-=cut
-
-This is more random text.
-###
-This is some random text.
-This is more random text.
-
-This is some random text.
-This is more random text.
-
-SAMPLE
- This is POD.
-
-
-This is more random text.
-###
-###
-
-###
-sentence 1
-###
-=head1 EXAMPLE
-
-Whitespace around C<< this. >> must be ignored per perlpodspec. >>
-needs to eat all of the space in front of it.
-
-=cut
-###
-EXAMPLE
- Whitespace around "this." must be ignored per perlpodspec. >> needs to
- eat all of the space in front of it.
-
-###
-###
-
-###
-###
-=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'
-
-###
-###
-
-###
-stderr 1
-###
-=over 4
-
-=item Foo
-
-Bar.
-
-=head1 NEXT
-###
- Foo Bar.
-
-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
-###
-###
-
-###
-quotes <<<>>>
-###
-=head1 FOO C<BAR> BAZ
-
-Foo C<bar> baz.
-###
-FOO <<<BAR>>> BAZ
- Foo <<<bar>>> baz.
-
-###
-###
diff --git a/cpan/podlators/t/text/snippets.t b/cpan/podlators/t/text/snippets.t
new file mode 100644
index 0000000000..19fd7c879b
--- /dev/null
+++ b/cpan/podlators/t/text/snippets.t
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+#
+# Test Pod::Text behavior with various snippets.
+#
+# Copyright 2002, 2004, 2006-2009, 2012, 2018-2019
+# 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.008;
+use strict;
+use warnings;
+
+use lib 't/lib';
+
+use Test::More tests => 51;
+use Test::Podlators qw(test_snippet);
+
+# Load the module.
+BEGIN {
+ use_ok('Pod::Text');
+}
+
+# List of snippets run by this test.
+my @snippets = qw(
+ alt c-with-spaces code cpp error-die error-none error-normal error-pod
+ error-stderr error-stderr-opt for late-encoding link-rt link-url margin
+ nonbreaking-space nourls periods quotes-opt s-whitespace sentence-spacing
+ utf8 verbatim
+);
+
+# Run all the tests.
+for my $snippet (@snippets) {
+ test_snippet('Pod::Text', "text/$snippet");
+}
diff --git a/cpan/podlators/t/text/termcap.t b/cpan/podlators/t/text/termcap.t
index 4a9893a9da..598e0b5620 100644
--- a/cpan/podlators/t/text/termcap.t
+++ b/cpan/podlators/t/text/termcap.t
@@ -2,19 +2,21 @@
#
# Test Pod::Text::Termcap behavior with various snippets.
#
-# Copyright 2002, 2004, 2006, 2009, 2012-2014, 2018
+# Copyright 2002, 2004, 2006, 2009, 2012-2014, 2018-2019
# 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 5.008;
use strict;
use warnings;
use lib 't/lib';
-use Test::More tests => 11;
+use Test::More tests => 15;
use Test::Podlators qw(test_snippet);
# Load the module.
@@ -28,6 +30,10 @@ $ENV{TERM} = 'xterm';
$ENV{TERMPATH} = File::Spec->catfile('t', 'data', 'termcap');
$ENV{TERMCAP} = 'xterm:co=#80:do=^J:md=\E[1m:us=\E[4m:me=\E[m';
+# Check the regex that matches a single formatting character.
+my $parser = Pod::Text::Termcap->new();
+is($parser->format_regex(), "\\\e\\[1m|\\\e\\[4m|\\\e\\[m", 'Character regex');
+
# List of snippets run by this test.
my @snippets = qw(escape-wrapping tag-width tag-wrapping width wrapping);
@@ -35,3 +41,15 @@ my @snippets = qw(escape-wrapping tag-width tag-wrapping width wrapping);
for my $snippet (@snippets) {
test_snippet('Pod::Text::Termcap', "termcap/$snippet");
}
+
+# Now test with an unknown terminal type.
+$ENV{TERM} = 'unknown';
+$ENV{TERMCAP} = 'unknown:co=#80:do=^J';
+test_snippet('Pod::Text::Termcap', 'termcap/term-unknown');
+
+# Test the character regex with a fake terminal type that only provides bold
+# and normal, not underline.
+$ENV{TERM} = 'fake-test-terminal';
+$ENV{TERMCAP} = 'fake-test-terminal:md=\E[1m:me=\E[m';
+$parser = Pod::Text::Termcap->new();
+is($parser->format_regex(), "\\\e\\[1m|\\\e\\[m", 'Limited character regex');
diff --git a/cpan/podlators/t/text/utf8.t b/cpan/podlators/t/text/utf8.t
deleted file mode 100644
index a04010ea10..0000000000
--- a/cpan/podlators/t/text/utf8.t
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Test Pod::Text with UTF-8 input.
-#
-# 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';
- if ($ENV{PERL_CORE}) {
- @INC = '../lib';
- }
- unshift (@INC, '../blib/lib');
- $| = 1;
-}
-
-use strict;
-
-use Test::More;
-
-# UTF-8 support requires Perl 5.8 or later.
-BEGIN {
- if ($] < 5.008) {
- plan skip_all => 'Perl 5.8 required for UTF-8 support';
- } else {
- plan tests => 4;
- }
-}
-BEGIN { use_ok ('Pod::Text') }
-
-# Force UTF-8 on all relevant file handles. Hide this in a string eval so
-# that older versions of Perl don't croak and minimum-version tests still
-# pass.
-eval 'binmode (\*DATA, ":encoding(utf-8)")';
-eval 'binmode (\*STDOUT, ":encoding(utf-8)")';
-my $builder = Test::More->builder;
-eval 'binmode ($builder->output, ":encoding(utf-8)")';
-eval 'binmode ($builder->failure_output, ":encoding(utf-8)")';
-
-my $parser = Pod::Text->new;
-isa_ok ($parser, 'Pod::Text', 'Parser object');
-my $n = 1;
-while (<DATA>) {
- next until $_ eq "###\n";
- open (TMP, "> tmp$$.pod") or die "Cannot create tmp$$.pod: $!\n";
- eval 'binmode (\*TMP, ":encoding(utf-8)")';
- print TMP "=encoding UTF-8\n\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";
- eval 'binmode (\*TMP, ":encoding(utf-8)")';
- 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 text output.
-# This is used to test specific features or problems with Pod::Text. The
-# input and output are separated by lines containing only ###.
-
-__DATA__
-
-###
-=head1 Test of SE<lt>E<gt>
-
-This is S<some whitespace>.
-###
-Test of S<>
- This is some whitespace.
-
-###
-
-###
-=head1 I can eat glass
-
-=over 4
-
-=item Esperanto
-
-Mi povas manĝi vitron, ĝi ne damaĝas min.
-
-=item Braille
-
-⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑
-
-=item Hindi
-
-मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती.
-
-=back
-
-See L<http://www.columbia.edu/kermit/utf8.html>
-###
-I can eat glass
- Esperanto
- Mi povas manĝi vitron, ĝi ne damaĝas min.
-
- Braille
- ⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑
-
- Hindi
- मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती.
-
- See <http://www.columbia.edu/kermit/utf8.html>
-
-###