diff options
author | Étienne Mollier <etienne.mollier@mailoo.org> | 2020-07-21 21:19:52 +0200 |
---|---|---|
committer | Étienne Mollier <etienne.mollier@mailoo.org> | 2020-07-21 21:19:52 +0200 |
commit | a6b182167ddd520a41a5f365e8e19287dac248b9 (patch) | |
tree | 69306d51b1dfaf29f9f28f49f2e9475f161ceec0 | |
parent | 76d98e02e881af3a9af8ded7ca57b7e9f933616c (diff) | |
parent | 4d3d310acc9f86ac6f0a04992d8ce5a758f55e16 (diff) |
Update upstream source from tag 'upstream/0.006'
Update to upstream version '0.006'
with Debian dir b2c9fcc1e64a750669d971612d95d7905b838968
-rw-r--r-- | Changes | 16 | ||||
-rw-r--r-- | META.json | 3 | ||||
-rw-r--r-- | META.yml | 3 | ||||
-rw-r--r-- | Makefile.PL | 4 | ||||
-rw-r--r-- | README | 11 | ||||
-rw-r--r-- | dist.ini | 3 | ||||
-rw-r--r-- | lib/Test/Regexp/Pattern.pm | 22 | ||||
-rwxr-xr-x | script/test-regexp-pattern | 6 |
8 files changed, 47 insertions, 21 deletions
@@ -1,3 +1,19 @@ +0.006 2020-01-04 Released-By: PERLANCAR; Urgency: medium + + [doc] + + - Update doc (DZP:Test::Regexp::Pattern does not exist, or I + haven't written it; mention DZP:Regexp::Pattern instead which + includes the functionality). + + - Fix example in Synopsis [GH#3]. + + [internal] + + - Use Hash::DefHash so we properly ignore ignorable + properties/attributes [GH#4]. + + 0.005 2020-01-02 Released-By: PERLANCAR; Urgency: medium - Generate anchored regex pattern if anchor=>1 in example. @@ -34,6 +34,7 @@ "requires" : { "File::Spec" : "0", "Getopt::Long" : "2.50", + "Hash::DefHash" : "0.06", "Regexp::Pattern" : "v0.2.7", "Test::Builder" : "0", "Test::More" : "0", @@ -63,7 +64,7 @@ "web" : "https://github.com/perlancar/perl-Test-Regexp-Pattern" } }, - "version" : "0.005", + "version" : "0.006", "x_Dist_Zilla" : { "perl" : { "version" : "5.030000" @@ -19,6 +19,7 @@ name: Test-Regexp-Pattern requires: File::Spec: '0' Getopt::Long: '2.50' + Hash::DefHash: '0.06' Regexp::Pattern: v0.2.7 Test::Builder: '0' Test::More: '0' @@ -29,7 +30,7 @@ resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Regexp-Pattern homepage: https://metacpan.org/release/Test-Regexp-Pattern repository: git://github.com/perlancar/perl-Test-Regexp-Pattern.git -version: '0.005' +version: '0.006' x_Dist_Zilla: perl: version: '5.030000' diff --git a/Makefile.PL b/Makefile.PL index b6bcb38..2711d85 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -22,6 +22,7 @@ my %WriteMakefileArgs = ( "PREREQ_PM" => { "File::Spec" => 0, "Getopt::Long" => "2.50", + "Hash::DefHash" => "0.06", "Regexp::Pattern" => "0.2.7", "Test::Builder" => 0, "Test::More" => 0, @@ -34,7 +35,7 @@ my %WriteMakefileArgs = ( "IPC::Open3" => 0, "Test::More" => 0 }, - "VERSION" => "0.005", + "VERSION" => "0.006", "test" => { "TESTS" => "t/*.t" } @@ -44,6 +45,7 @@ my %WriteMakefileArgs = ( my %FallbackPrereqs = ( "File::Spec" => 0, "Getopt::Long" => "2.50", + "Hash::DefHash" => "0.06", "IO::Handle" => 0, "IPC::Open3" => 0, "Regexp::Pattern" => "0.2.7", @@ -2,13 +2,13 @@ NAME Test::Regexp::Pattern - Test Regexp::Pattern patterns VERSION - This document describes version 0.005 of Test::Regexp::Pattern (from - Perl distribution Test-Regexp-Pattern), released on 2020-01-02. + This document describes version 0.006 of Test::Regexp::Pattern (from + Perl distribution Test-Regexp-Pattern), released on 2020-01-04. SYNOPSIS To check all regexp patterns in a module: - use Test::Regexp::Patterns tests=>1; + use Test::Regexp::Pattern; regexp_patterns_in_module_ok("Foo::Bar", {opt => ...}, $msg); Alternatively, you can check all regexp patterns in all modules in a @@ -26,7 +26,8 @@ DESCRIPTION patterns. It is recommended that you include something like "release-regexp-pattern.t" in your distribution if you add regexp patterns to your code. If you use Dist::Zilla to build your - distribution, there is [Test::Regexp::Pattern] to make it easy to do so. + distribution, there is [Regexp::Pattern] which automatically adds a + release test file for this during build. ACKNOWLEDGEMENTS Some code taken from Test::Pod::Coverage by Andy Lester. @@ -68,7 +69,7 @@ SEE ALSO Regexp::Pattern - Dist::Zilla::Plugin::Test::Regexp::Pattern + Dist::Zilla::Plugin::Regexp::Pattern AUTHOR perlancar <perlancar@cpan.org> @@ -1,4 +1,4 @@ -version=0.005 +version=0.006 name=Test-Regexp-Pattern @@ -12,6 +12,7 @@ strict=0 warnings=0 File::Spec=0 Getopt::Long=2.50 +Hash::DefHash=0.06 Regexp::Pattern=0.2.7 Test::Builder=0 Test::More=0 diff --git a/lib/Test/Regexp/Pattern.pm b/lib/Test/Regexp/Pattern.pm index cfc3565..5d0d445 100644 --- a/lib/Test/Regexp/Pattern.pm +++ b/lib/Test/Regexp/Pattern.pm @@ -2,15 +2,18 @@ package Test::Regexp::Pattern; -our $DATE = '2020-01-02'; # DATE -our $VERSION = '0.005'; # VERSION +our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY +our $DATE = '2020-01-04'; # DATE +our $DIST = 'Test-Regexp-Pattern'; # DIST +our $VERSION = '0.006'; # VERSION use 5.010001; use strict 'subs', 'vars'; use warnings; -use Regexp::Pattern qw(re); use File::Spec; +use Hash::DefHash; # exports defhash() +use Regexp::Pattern qw(re); use Test::Builder; use Test::More (); @@ -144,7 +147,8 @@ sub regexp_patterns_in_module_ok { goto L1; } - for my $name (sort keys %{ "$module\::RE" }) { + my $dh = defhash(\%{ "$module\::RE" }); + for my $name ($dh->props) { my $re = ${"$module\::RE"}{$name}; $has_tests++; $Test->subtest( @@ -265,13 +269,13 @@ Test::Regexp::Pattern - Test Regexp::Pattern patterns =head1 VERSION -This document describes version 0.005 of Test::Regexp::Pattern (from Perl distribution Test-Regexp-Pattern), released on 2020-01-02. +This document describes version 0.006 of Test::Regexp::Pattern (from Perl distribution Test-Regexp-Pattern), released on 2020-01-04. =head1 SYNOPSIS To check all regexp patterns in a module: - use Test::Regexp::Patterns tests=>1; + use Test::Regexp::Pattern; regexp_patterns_in_module_ok("Foo::Bar", {opt => ...}, $msg); Alternatively, you can check all regexp patterns in all modules in a distro: @@ -289,8 +293,8 @@ This module performs various checks on a module's L<Regexp::Pattern> patterns. It is recommended that you include something like C<release-regexp-pattern.t> in your distribution if you add regexp patterns to your code. If you use L<Dist::Zilla> to build your distribution, there is -L<[Test::Regexp::Pattern]|Dist::Zilla::Plugin::Test::Regexp::Pattern> to make it -easy to do so. +L<[Regexp::Pattern]|Dist::Zilla::Plugin::Regexp::Pattern> which automatically +adds a release test file for this during build. =for Pod::Coverage ^(all_modules)$ @@ -344,7 +348,7 @@ C<regexp_patterns_in_all_modules_ok()>. L<Regexp::Pattern> -L<Dist::Zilla::Plugin::Test::Regexp::Pattern> +L<Dist::Zilla::Plugin::Regexp::Pattern> =head1 AUTHOR diff --git a/script/test-regexp-pattern b/script/test-regexp-pattern index de93555..0932d18 100755 --- a/script/test-regexp-pattern +++ b/script/test-regexp-pattern @@ -1,7 +1,7 @@ #!perl -our $DATE = '2020-01-02'; # DATE -our $VERSION = '0.005'; # VERSION +our $DATE = '2020-01-04'; # DATE +our $VERSION = '0.006'; # VERSION use 5.010; use strict; @@ -40,7 +40,7 @@ test-regexp-pattern - Test Regexp::Pattern patterns in all modules of your distr =head1 VERSION -This document describes version 0.005 of test-regexp-pattern (from Perl distribution Test-Regexp-Pattern), released on 2020-01-02. +This document describes version 0.006 of test-regexp-pattern (from Perl distribution Test-Regexp-Pattern), released on 2020-01-04. =head1 SYNOPSIS |