summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorperlancar (on netbook-dell-xps13) <perlancar@gmail.com>2020-01-04 07:13:31 +0700
committerperlancar (on netbook-dell-xps13) <perlancar@gmail.com>2020-01-04 07:13:31 +0700
commitd64821dc687f5cf3c31899053f269677f9b50c7f (patch)
treec8e9607e674feab917a0512f15e94282cdcdd065
parent9dbd6cc0e98b1b9fffa95bd9554c8bcfa4c3a66a (diff)
Use Hash::DefHash
-rw-r--r--dist.ini1
-rw-r--r--lib/Test/Regexp/Pattern.pm8
2 files changed, 7 insertions, 2 deletions
diff --git a/dist.ini b/dist.ini
index a1a87f3..42fd943 100644
--- a/dist.ini
+++ b/dist.ini
@@ -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 6d92e5e..d9f254a 100644
--- a/lib/Test/Regexp/Pattern.pm
+++ b/lib/Test/Regexp/Pattern.pm
@@ -2,15 +2,18 @@
package Test::Regexp::Pattern;
+# AUTHORITY
# DATE
+# DIST
# 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(