This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
corelist: silence deep recursion warning with %version
authorNiko Tyni <ntyni@debian.org>
Tue, 26 Apr 2016 21:34:51 +0000 (17:34 -0400)
committerRicardo Signes <rjbs@cpan.org>
Tue, 26 Apr 2016 21:41:35 +0000 (17:41 -0400)
dist/Module-CoreList/lib/Module/CoreList/TieHashDelta.pm
dist/Module-CoreList/t/corelist.t

index 94507d7..c58bc4c 100644 (file)
@@ -48,6 +48,9 @@ sub FIRSTKEY {
     my ($self) = @_;
 
     if (not $self->{keys_inflated}) {
+        # exceeds the warning limit of 100 calls since 5.23.2
+        no warnings 'recursion';
+
         # This inflates the whole set of hashes... Somewhat expensive, but saves
         # many tied hash calls later.
         my @parent_keys;
index db09f48..4adbbe9 100644 (file)
@@ -1,7 +1,7 @@
 #!perl -w
 use strict;
 use Module::CoreList;
-use Test::More tests => 32;
+use Test::More tests => 34;
 
 BEGIN { require_ok('Module::CoreList'); }
 
@@ -105,6 +105,12 @@ is(Module::CoreList::removed_from('CPANPLUS::inc'), 5.010001,
 
     cmp_ok($warnings_count, '==', 0,
            "an undefined version does not produce warnings rt#123556");
+
+    ok(keys %{$Module::CoreList::version{5.023002}} > 0,
+       "have recent enough data to test for deep recursion warnings");
+
+    cmp_ok($warnings_count, '==', 0,
+           "no deep recursion warnings for newer perl versions");
 }
 
 ok(! defined(Module::CoreList->find_version()),