This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add test for rt#123556
authorAndreas Voegele <andreas@andreasvoegele.com>
Wed, 7 Jan 2015 19:36:14 +0000 (20:36 +0100)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 7 Jan 2015 22:00:53 +0000 (14:00 -0800)
dist/Module-CoreList/t/corelist.t

index d8e93bf..c129584 100644 (file)
@@ -1,7 +1,7 @@
 #!perl -w
 use strict;
 use Module::CoreList;
-use Test::More tests => 25;
+use Test::More tests => 29;
 
 BEGIN { require_ok('Module::CoreList'); }
 
@@ -89,3 +89,20 @@ is(Module::CoreList->removed_from('CPANPLUS::inc'), 5.010001,
 is(Module::CoreList::removed_from('CPANPLUS::inc'), 5.010001, 
    "CPANPLUS::inc was removed from 5.010001");
 
+{
+    my $warnings_count = 0;
+    local $SIG{__WARN__} = sub { $warnings_count++ };
+    local $^W = 1;
+
+    ok(exists $Module::CoreList::version{5}{strict},
+       "strict was in 5");
+
+    ok(!defined $Module::CoreList::version{5}{strict},
+       "strict had no version in 5");
+
+    is(Module::CoreList::first_release('strict', 1.01), 5.00405,
+       "strict reached 1.01 with 5.00405");
+
+    cmp_ok($warnings_count, '==', 0,
+           "an undefined version does not produce warnings rt#123556");
+}