summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/podlators/t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/cpan/podlators/t')
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/docs/pod-spelling.t6
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/docs/pod.t6
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/docs/synopsis.t6
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/docs/urls.t95
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/general/basic.t4
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/general/filehandle.t4
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/general/pod-parser.t4
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/lib/Test/Podlators.pm78
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA.pm83
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/Config.pm16
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm36
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/man/devise-date.t6
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/man/devise-title.t4
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/man/empty.t4
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/man/heading.t4
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/man/no-encode.t13
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/man/utf8-io.t17
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/parselink/basic.t212
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/style/minimum-version.t6
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/style/module-version.t7
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/style/strict.t50
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/basic.t157
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/color.t4
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/empty.t54
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/encoding.t158
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/options.t368
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/overstrike.t108
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/perlio.t129
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/termcap.t24
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/t/text/utf8.t128
30 files changed, 358 insertions, 1433 deletions
diff --git a/gnu/usr.bin/perl/cpan/podlators/t/docs/pod-spelling.t b/gnu/usr.bin/perl/cpan/podlators/t/docs/pod-spelling.t
index 94d75035bc6..819aa693314 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/docs/pod-spelling.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/docs/pod.t b/gnu/usr.bin/perl/cpan/podlators/t/docs/pod.t
index 5fcfcdf77cf..e7d02316606 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/docs/pod.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/docs/synopsis.t b/gnu/usr.bin/perl/cpan/podlators/t/docs/synopsis.t
index 43a8354ba40..1a2fbf1af28 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/docs/synopsis.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/docs/urls.t b/gnu/usr.bin/perl/cpan/podlators/t/docs/urls.t
deleted file mode 100644
index a654c5453c2..00000000000
--- a/gnu/usr.bin/perl/cpan/podlators/t/docs/urls.t
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/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/gnu/usr.bin/perl/cpan/podlators/t/general/basic.t b/gnu/usr.bin/perl/cpan/podlators/t/general/basic.t
index 717e3762dfd..d4978bcf366 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/general/basic.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/general/filehandle.t b/gnu/usr.bin/perl/cpan/podlators/t/general/filehandle.t
index 42601a05878..3c5d753a480 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/general/filehandle.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/general/pod-parser.t b/gnu/usr.bin/perl/cpan/podlators/t/general/pod-parser.t
index 9c51aff87a4..c008499298e 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/general/pod-parser.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/Podlators.pm b/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/Podlators.pm
index 3ae940924e2..9254f26468e 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/Podlators.pm
+++ b/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/Podlators.pm
@@ -8,7 +8,7 @@
package Test::Podlators;
-use 5.006;
+use 5.008;
use strict;
use warnings;
@@ -91,7 +91,6 @@ sub _stderr_restore {
# For the format, see t/data/snippets/README.
#
# $path - Relative path to read test data from
-# $encoding - Encoding of snippet (UTF-8 if not specified)
#
# Returns: Reference to hash of test data with the following keys:
# name - Name of the test for status reporting
@@ -101,20 +100,18 @@ sub _stderr_restore {
# errors - Expected errors
# exception - Text of exception (with file and line stripped)
sub read_snippet {
- my ($path, $encoding) = @_;
+ my ($path) = @_;
$path = File::Spec->catfile('t', 'data', 'snippets', $path);
- $encoding ||= 'UTF-8';
my %data;
# Read the sections and store them in the %data hash.
my ($line, $section);
open(my $fh, '<', $path) or BAIL_OUT("cannot open $path: $!");
while (defined($line = <$fh>)) {
- $line = decode($encoding, $line);
if ($line =~ m{ \A \s* \[ (\S+) \] \s* \z }xms) {
$section = $1;
+ $data{$section} = q{};
} elsif ($section) {
- $data{$section} ||= q{};
$data{$section} .= $line;
}
}
@@ -248,11 +245,17 @@ sub slurp {
# $class - Class name of the formatter, as a string
# $snippet - Path to the snippet file defining the test
# $options_ref - Hash of options with the following keys:
-# encoding - Set to use a non-standard encoding
+# encoding - Expect the output to be in this non-standard encoding
sub test_snippet {
my ($class, $snippet, $options_ref) = @_;
- my $encoding = defined($options_ref) ? $options_ref->{encoding} : undef;
- my $data_ref = read_snippet($snippet, $encoding);
+ my $data_ref = read_snippet($snippet);
+
+ # Determine the encoding to expect for the output portion of the snippet.
+ my $encoding;
+ if (defined($options_ref)) {
+ $encoding = $options_ref->{encoding};
+ }
+ $encoding ||= 'UTF-8';
# Create the formatter object.
my $parser = $class->new(%{ $data_ref->{options} }, name => 'TEST');
@@ -277,9 +280,10 @@ sub test_snippet {
$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}) {
- is($stderr, $data_ref->{errors}, "$data_ref->{name}: errors");
+ my $expected = decode($encoding, $data_ref->{output});
+ is($got, $expected, "$data_ref->{name}: output");
+ if ($data_ref->{errors} || $stderr) {
+ is($stderr, $data_ref->{errors} || q{}, "$data_ref->{name}: errors");
}
if ($data_ref->{exception} || $exception) {
if ($exception) {
@@ -299,11 +303,19 @@ sub test_snippet {
# $class - Class name of the formatter, as a string
# $snippet - Path to the snippet file defining the test
# $options_ref - Hash of options with the following keys:
+# encoding - Expect the snippet to be in this non-standard encoding
# perlio_utf8 - Set to 1 to set a PerlIO UTF-8 encoding on the output file
sub test_snippet_with_io {
my ($class, $snippet, $options_ref) = @_;
my $data_ref = read_snippet($snippet);
+ # Determine the encoding to expect for the output portion of the snippet.
+ my $encoding;
+ if (defined($options_ref)) {
+ $encoding = $options_ref->{encoding};
+ }
+ $encoding ||= 'UTF-8';
+
# Create the formatter object.
my $parser = $class->new(%{ $data_ref->{options} }, name => 'TEST');
isa_ok($parser, $class, 'Parser object');
@@ -317,7 +329,7 @@ sub test_snippet_with_io {
my $input_file = File::Spec->catfile('t', 'tmp', "tmp$$.pod");
open(my $input, '>', $input_file)
or BAIL_OUT("cannot create $input_file: $!");
- print {$input} encode('UTF-8', $data_ref->{input})
+ print {$input} $data_ref->{input}
or BAIL_OUT("cannot write to $input_file: $!");
close($input) or BAIL_OUT("cannot flush output to $input_file: $!");
@@ -336,20 +348,23 @@ sub test_snippet_with_io {
$parser->parse_from_file($input_file, $output);
close($output) or BAIL_OUT("cannot flush output to $output_file: $!");
- # Read back in the results, checking to ensure that we didn't output the
- # accent definitions if we wrote UTF-8 output.
+ # Read back in the results. For Pod::Man, also ensure that we didn't
+ # output the accent definitions if we wrote UTF-8 output.
open(my $results, '<', $output_file)
or BAIL_OUT("cannot open $output_file: $!");
my ($line, $saw_accents);
- while (defined($line = <$results>)) {
- $line = decode('UTF-8', $line);
- if ($line =~ m{ Accent [ ] mark [ ] definitions }xms) {
- $saw_accents = 1;
+ if ($class eq 'Pod::Man') {
+ while (defined($line = <$results>)) {
+ $line = decode('UTF-8', $line);
+ if ($line =~ m{ Accent [ ] mark [ ] definitions }xms) {
+ $saw_accents = 1;
+ }
+ last if $line =~ m{ \A [.]nh }xms;
}
- last if $line =~ m{ \A [.]nh }xms;
}
my $saw = do { local $/ = undef; <$results> };
$saw = decode('UTF-8', $saw);
+ $saw =~ s{ \n\s+ \z }{\n}xms;
close($results) or BAIL_OUT("cannot close output file: $!");
# Clean up.
@@ -357,12 +372,18 @@ sub test_snippet_with_io {
# Check the accent definitions and the output.
my $perlio = $options_ref->{perlio_utf8} ? ' (PerlIO)' : q{};
+ if ($class eq 'Pod::Man') {
+ is(
+ $saw_accents,
+ $data_ref->{options}{utf8} ? undef : 1,
+ "$data_ref->{name}: accent definitions$perlio"
+ );
+ }
is(
- $saw_accents,
- $data_ref->{options}{utf8} ? undef : 1,
- "$data_ref->{name}: accent definitions$perlio"
+ $saw,
+ decode($encoding, $data_ref->{output}),
+ "$data_ref->{name}: output$perlio"
);
- is($saw, $data_ref->{output}, "$data_ref->{name}: output$perlio");
return;
}
@@ -396,15 +417,12 @@ should be explicitly imported.
=over 4
-=item read_snippet(PATH[, ENCODING])
+=item read_snippet(PATH)
Read one test snippet from the provided relative file name and return it. The
path should be relative to F<t/data/snippets>. For the format, see
F<t/data/snippets/README>.
-ENCODING, if present, specifies the encoding of the snippet. If not given,
-the snippet is assumed to be encoded in C<UTF-8>.
-
The result will be a hash with the following keys:
=over 4
@@ -489,7 +507,7 @@ it, and checking the results. Results are reported with Test::More.
OPTIONS, if present, is a reference to a hash of options. Currently, only
one key is supported: C<encoding>, which, if set, specifies the encoding of
-the snippet.
+the output portion of the snippet.
=item test_snippet_with_io(CLASS, SNIPPET[, OPTIONS])
@@ -509,7 +527,7 @@ Russ Allbery <rra@cpan.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2015, 2016, 2018 Russ Allbery <rra@cpan.org>
+Copyright 2015-2016, 2018-2020 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/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA.pm b/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA.pm
index cbfdc42603c..1d5e4db23d4 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA.pm
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/Config.pm b/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/Config.pm
index b2f94466dd2..80a15739410 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/Config.pm
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm b/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
index 3b3d6742df9..fc8bfbc8de5 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/lib/Test/RRA/ModuleVersion.pm
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/man/devise-date.t b/gnu/usr.bin/perl/cpan/podlators/t/man/devise-date.t
index 129721323c6..4729e0bf0f5 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/man/devise-date.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/man/devise-title.t b/gnu/usr.bin/perl/cpan/podlators/t/man/devise-title.t
index a7e5e7b89d2..b2e82468b47 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/man/devise-title.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/man/empty.t b/gnu/usr.bin/perl/cpan/podlators/t/man/empty.t
index 4924fc8466a..cd0cfccc37d 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/man/empty.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/man/heading.t b/gnu/usr.bin/perl/cpan/podlators/t/man/heading.t
index 9691446b6f6..f8964025e3f 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/man/heading.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/man/no-encode.t b/gnu/usr.bin/perl/cpan/podlators/t/man/no-encode.t
index 15522a5d96a..199016217d2 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/man/no-encode.t
+++ b/gnu/usr.bin/perl/cpan/podlators/t/man/no-encode.t
@@ -3,22 +3,25 @@
# Test for graceful degradation to non-utf8 output without Encode module.
#
# Copyright 2016 Niko Tyni <ntyni@iki.fi>
-# Copyright 2016, 2018 Russ Allbery <rra@cpan.org>
+# Copyright 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;
-use Test::More tests => 6;
+use Test::More tests => 5;
-# Force the Encode module to be impossible to import.
+# 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 {
- ok(!$INC{'Encode.pm'}, 'Encode is not loaded yet');
+ delete $INC{'Encode.pm'};
my $reject_encode = sub {
if ($_[1] eq 'Encode.pm') {
die "refusing to load Encode\n";
diff --git a/gnu/usr.bin/perl/cpan/podlators/t/man/utf8-io.t b/gnu/usr.bin/perl/cpan/podlators/t/man/utf8-io.t
index d1c950076b3..76e21b98f04 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/man/utf8-io.t
+++ b/gnu/usr.bin/perl/cpan/podlators/t/man/utf8-io.t
@@ -1,8 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# 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-2020
# 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/gnu/usr.bin/perl/cpan/podlators/t/parselink/basic.t b/gnu/usr.bin/perl/cpan/podlators/t/parselink/basic.t
index 48fbb37f137..0f39e563976 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/parselink/basic.t
+++ b/gnu/usr.bin/perl/cpan/podlators/t/parselink/basic.t
@@ -1,122 +1,120 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
-# parselink.t -- Tests for Pod::ParseLink.
+# Tests for Pod::ParseLink.
#
-# Copyright 2001, 2009, 2018 by Russ Allbery <rra@cpan.org>
+# Copyright 2001, 2009, 2018, 2020 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.
-our @TESTS = (
- [ 'foo',
- undef, 'foo', 'foo', undef, 'pod' ],
-
- [ 'foo|bar',
- 'foo', 'foo', 'bar', undef, 'pod' ],
-
- [ 'foo/bar',
- undef, '"bar" in foo', 'foo', 'bar', 'pod' ],
-
- [ 'foo/"baz boo"',
- undef, '"baz boo" in foo', 'foo', 'baz boo', 'pod' ],
-
- [ '/bar',
- undef, '"bar"', undef, 'bar', 'pod' ],
-
- [ '/"baz boo"',
- undef, '"baz boo"', undef, 'baz boo', 'pod' ],
-
- [ '/baz boo',
- undef, '"baz boo"', undef, 'baz boo', 'pod' ],
-
- [ 'foo bar/baz boo',
- undef, '"baz boo" in foo bar', 'foo bar', 'baz boo', 'pod' ],
-
- [ 'foo bar / baz boo',
- undef, '"baz boo" in foo bar', 'foo bar', 'baz boo', 'pod' ],
-
- [ "foo\nbar\nbaz\n/\nboo",
- undef, '"boo" in foo bar baz', 'foo bar baz', 'boo', 'pod' ],
-
- [ 'anchor|name/section',
- 'anchor', 'anchor', 'name', 'section', 'pod' ],
-
- [ '"boo var baz"',
- undef, '"boo var baz"', undef, 'boo var baz', 'pod' ],
-
- [ 'bar baz',
- undef, '"bar baz"', undef, 'bar baz', 'pod' ],
-
- [ '"boo bar baz / baz boo"',
- undef, '"boo bar baz / baz boo"', undef, 'boo bar baz / baz boo',
- 'pod' ],
-
- [ 'fooZ<>bar',
- undef, 'fooZ<>bar', 'fooZ<>bar', undef, 'pod' ],
-
- [ 'Testing I<italics>|foo/bar',
- 'Testing I<italics>', 'Testing I<italics>', 'foo', 'bar', 'pod' ],
-
- [ 'foo/I<Italic> text',
- undef, '"I<Italic> text" in foo', 'foo', 'I<Italic> text', 'pod' ],
-
- [ 'fooE<verbar>barZ<>/Section C<with> I<B<other> markup',
- undef, '"Section C<with> I<B<other> markup" in fooE<verbar>barZ<>',
- 'fooE<verbar>barZ<>', 'Section C<with> I<B<other> markup', 'pod' ],
-
- [ 'Nested L<http://www.perl.org/>|fooE<sol>bar',
- 'Nested L<http://www.perl.org/>', 'Nested L<http://www.perl.org/>',
- 'fooE<sol>bar', undef, 'pod' ],
-
- [ 'ls(1)',
- undef, 'ls(1)', 'ls(1)', undef, 'man' ],
-
- [ ' perlfunc(1)/open ',
- undef, '"open" in perlfunc(1)', 'perlfunc(1)', 'open', 'man' ],
-
- [ 'some manual page|perl(1)',
- 'some manual page', 'some manual page', 'perl(1)', undef, 'man' ],
-
- [ 'http://www.perl.org/',
- undef, 'http://www.perl.org/', 'http://www.perl.org/', undef, 'url' ],
-
- [ 'news:yld72axzc8.fsf@windlord.stanford.edu',
- undef, 'news:yld72axzc8.fsf@windlord.stanford.edu',
- 'news:yld72axzc8.fsf@windlord.stanford.edu', undef, 'url' ],
-
- [ 'link|http://www.perl.org/',
- 'link', 'link', 'http://www.perl.org/', undef, 'url' ],
-
- [ '0|http://www.perl.org/',
- '0', '0', 'http://www.perl.org/', undef, 'url' ],
+use 5.008;
+use strict;
+use warnings;
- [ '0|Pod::Parser',
- '0', '0', 'Pod::Parser', undef, 'pod' ],
-);
+use Test::More tests => 28;
BEGIN {
- chdir 't' if -d 't';
- unshift (@INC, '../blib/lib');
- $| = 1;
+ use_ok('Pod::ParseLink');
}
-use strict;
-
-use Test::More tests => 28;
-BEGIN { use_ok ('Pod::ParseLink') }
-
-# Used for reporting test failures.
-my @names = qw(text inferred name section type);
+# The format of each entry in this array is the L<> text followed by the
+# five-element parse returned by parselink.
+our @TESTS = (
+ ['foo' => (undef, 'foo', 'foo', undef, 'pod')],
+ ['foo|bar' => ('foo', 'foo', 'bar', undef, 'pod')],
+ ['foo/bar' => (undef, '"bar" in foo', 'foo', 'bar', 'pod')],
+ ['foo/"baz boo"' => (undef, '"baz boo" in foo', 'foo', 'baz boo', 'pod')],
+ ['/bar' => (undef, '"bar"', undef, 'bar', 'pod')],
+ ['/"baz boo"' => (undef, '"baz boo"', undef, 'baz boo', 'pod')],
+ ['/baz boo', => (undef, '"baz boo"', undef, 'baz boo', 'pod')],
+ [
+ 'foo bar/baz boo' =>
+ (undef, '"baz boo" in foo bar', 'foo bar', 'baz boo', 'pod')
+ ],
+ [
+ 'foo bar / baz boo' =>
+ (undef, '"baz boo" in foo bar', 'foo bar', 'baz boo', 'pod')
+ ],
+ [
+ "foo\nbar\nbaz\n/\nboo" =>
+ (undef, '"boo" in foo bar baz', 'foo bar baz', 'boo', 'pod')
+ ],
+ ['anchor|name/section' => qw(anchor anchor name section pod)],
+ ['"boo var baz"' => (undef, '"boo var baz"', undef, 'boo var baz', 'pod')],
+ ['bar baz' => (undef, '"bar baz"', undef, 'bar baz', 'pod')],
+ [
+ '"boo bar baz / baz boo"' => (
+ undef, '"boo bar baz / baz boo"',
+ undef, 'boo bar baz / baz boo',
+ 'pod',
+ )
+ ],
+ ['fooZ<>bar' => (undef, 'fooZ<>bar', 'fooZ<>bar', undef, 'pod')],
+ [
+ 'Testing I<italics>|foo/bar' =>
+ ('Testing I<italics>', 'Testing I<italics>', 'foo', 'bar', 'pod')
+ ],
+ [
+ 'foo/I<Italic> text' =>
+ (undef, '"I<Italic> text" in foo', 'foo', 'I<Italic> text', 'pod')
+ ],
+ [
+ 'fooE<verbar>barZ<>/Section C<with> I<B<other> markup' => (
+ undef,
+ '"Section C<with> I<B<other> markup" in fooE<verbar>barZ<>',
+ 'fooE<verbar>barZ<>',
+ 'Section C<with> I<B<other> markup',
+ 'pod',
+ )
+ ],
+ [
+ 'Nested L<http://www.perl.org/>|fooE<sol>bar' => (
+ 'Nested L<http://www.perl.org/>',
+ 'Nested L<http://www.perl.org/>',
+ 'fooE<sol>bar', undef, 'pod',
+ )
+ ],
+ ['ls(1)' => (undef, 'ls(1)', 'ls(1)', undef, 'man')],
+ [
+ ' perlfunc(1)/open ' =>
+ (undef, '"open" in perlfunc(1)', 'perlfunc(1)', 'open', 'man')
+ ],
+ [
+ 'some manual page|perl(1)' =>
+ ('some manual page', 'some manual page', 'perl(1)', undef, 'man')
+ ],
+ [
+ 'http://www.perl.org/' => (
+ undef, 'http://www.perl.org/', 'http://www.perl.org/', undef,
+ 'url',
+ )
+ ],
+ [
+ 'news:yld72axzc8.fsf@windlord.stanford.edu' => (
+ undef,
+ 'news:yld72axzc8.fsf@windlord.stanford.edu',
+ 'news:yld72axzc8.fsf@windlord.stanford.edu',
+ undef, 'url',
+ )
+ ],
+ [
+ 'link|http://www.perl.org/' =>
+ ('link', 'link', 'http://www.perl.org/', undef, 'url')
+ ],
+ [
+ '0|http://www.perl.org/' =>
+ ('0', '0', 'http://www.perl.org/', undef, 'url')
+ ],
+ ['0|Pod::Parser' => ('0', '0', 'Pod::Parser', undef, 'pod')],
+);
-for (@TESTS) {
- my @expected = @$_;
- my $link = shift @expected;
- my @results = parselink ($link);
- my $pretty = $link;
- $pretty =~ s/\n/\\n/g;
- is_deeply (\@results, \@expected, $pretty);
+# Run all of the tests.
+for my $test (@TESTS) {
+ my ($link, @expected) = @$test;
+ my @results = parselink($link);
+ my $pretty = $link;
+ $pretty =~ s{\n}{\\n}xmsg;
+ is_deeply(\@results, \@expected, $pretty);
}
diff --git a/gnu/usr.bin/perl/cpan/podlators/t/style/minimum-version.t b/gnu/usr.bin/perl/cpan/podlators/t/style/minimum-version.t
index 7698c2babf1..861367de4ae 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/style/minimum-version.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/style/module-version.t b/gnu/usr.bin/perl/cpan/podlators/t/style/module-version.t
index 80368cb02e1..035b596de51 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/style/module-version.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/style/strict.t b/gnu/usr.bin/perl/cpan/podlators/t/style/strict.t
index a3d2a3e942c..a87c1fabca1 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/style/strict.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/text/basic.t b/gnu/usr.bin/perl/cpan/podlators/t/text/basic.t
deleted file mode 100644
index 024cc0e0e7f..00000000000
--- a/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/text/color.t b/gnu/usr.bin/perl/cpan/podlators/t/text/color.t
index b7edd48a27b..aa75beeb057 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/text/color.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/text/empty.t b/gnu/usr.bin/perl/cpan/podlators/t/text/empty.t
deleted file mode 100644
index e03a03c4a38..00000000000
--- a/gnu/usr.bin/perl/cpan/podlators/t/text/empty.t
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Test Pod::Text with a document that produces only errors.
-#
-# 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';
- if ($ENV{PERL_CORE}) {
- @INC = '../lib';
- }
- unshift (@INC, '../blib/lib');
- $| = 1;
-}
-
-use strict;
-
-use Test::More tests => 8;
-BEGIN { use_ok ('Pod::Text') }
-
-# Set up Pod::Text to output to a string.
-my $parser = Pod::Text->new;
-isa_ok ($parser, 'Pod::Text');
-my $output;
-$parser->output_string (\$output);
-
-# Try a POD document where the only command is invalid. Be sure that we don't
-# get any warnings as well as any errors.
-local $SIG{__WARN__} = sub { die $_[0] };
-ok (eval { $parser->parse_string_document("=\xa0") },
- 'Parsed invalid document');
-is ($@, '', '...with no errors');
-SKIP: {
- skip 'Pod::Simple does not produce errors for invalid commands', 1
- if $output eq q{};
- like ($output, qr{POD ERRORS},
- '...and output contains a POD ERRORS section');
-}
-
-# Try with a document containing only =cut.
-ok (eval { $parser->parse_string_document("=cut") },
- 'Parsed invalid document');
-is ($@, '', '...with no errors');
-SKIP: {
- skip 'Pod::Simple does not produce errors for invalid commands', 1
- if $output eq q{};
- like ($output, qr{POD ERRORS},
- '...and output contains a POD ERRORS section');
-}
diff --git a/gnu/usr.bin/perl/cpan/podlators/t/text/encoding.t b/gnu/usr.bin/perl/cpan/podlators/t/text/encoding.t
deleted file mode 100644
index 7a6b6f2801b..00000000000
--- a/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/text/options.t b/gnu/usr.bin/perl/cpan/podlators/t/text/options.t
deleted file mode 100644
index d191cf00f97..00000000000
--- a/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/text/overstrike.t b/gnu/usr.bin/perl/cpan/podlators/t/text/overstrike.t
index 7433264cb3c..7cdaa538b2d 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/text/overstrike.t
+++ b/gnu/usr.bin/perl/cpan/podlators/t/text/overstrike.t
@@ -1,8 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
-# Additional specialized tests for Pod::Text::Overstrike.
+# Test Pod::Text::Overstrike 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
@@ -10,97 +10,23 @@
#
# 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 5.008;
use strict;
+use warnings;
-use Test::More tests => 4;
-BEGIN { use_ok ('Pod::Text::Overstrike') }
-
-my $parser = Pod::Text::Overstrike->new;
-isa_ok ($parser, 'Pod::Text::Overstrike', '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>>.
-###
-WWRRAAPPPPIINNGG
- DDoo _n_o_t iinncclluuddee ffoorrmmaattttiinngg  ccooddeess  wwhheenn wwrraappppiinngg.
-
-###
-
-###
-=head1 TAG WIDTH
-
-=over 10
+use lib 't/lib';
-=item 12345678
+use Test::More tests => 5;
+use Test::Podlators qw(test_snippet);
-A
-
-=item B<12345678>
-
-B
-
-=item 1Z<>
-
-C
-
-=item B<1>
-
-D
-
-=back
-###
-TTAAGG  WWIIDDTTHH
- 12345678 A
-
- 1122334455667788 B
-
- 1 C
+BEGIN {
+ use_ok('Pod::Text::Overstrike');
+}
- 11 D
+# List of snippets run by this test.
+my @snippets = qw(tag-width wrapping);
-###
+# Run all the tests.
+for my $snippet (@snippets) {
+ test_snippet('Pod::Text::Overstrike', "overstrike/$snippet");
+}
diff --git a/gnu/usr.bin/perl/cpan/podlators/t/text/perlio.t b/gnu/usr.bin/perl/cpan/podlators/t/text/perlio.t
deleted file mode 100644
index 1b6523d328a..00000000000
--- a/gnu/usr.bin/perl/cpan/podlators/t/text/perlio.t
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Test Pod::Text with a PerlIO UTF-8 encoding layer.
-#
-# 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';
- 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 (utf8 => 1);
-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";
- eval 'binmode (\*OUT, ":encoding(utf-8)")';
- $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>
-
-###
diff --git a/gnu/usr.bin/perl/cpan/podlators/t/text/termcap.t b/gnu/usr.bin/perl/cpan/podlators/t/text/termcap.t
index 4a9893a9daa..598e0b56203 100644
--- a/gnu/usr.bin/perl/cpan/podlators/t/text/termcap.t
+++ b/gnu/usr.bin/perl/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/gnu/usr.bin/perl/cpan/podlators/t/text/utf8.t b/gnu/usr.bin/perl/cpan/podlators/t/text/utf8.t
deleted file mode 100644
index a04010ea101..00000000000
--- a/gnu/usr.bin/perl/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>
-
-###