This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Lots of C optimizations for both speed/correctness
[perl5.git] / cpan / version / t / 09_list_util.t
index f7fb89f..110c1a0 100644 (file)
@@ -4,34 +4,37 @@
 #########################
 
 use strict;
-use Test::More tests => 3;
-use_ok("version", 0.9905);
+use_ok("version", 0.9907);
+use Test::More;
 
-# do strict lax tests in a sub to isolate a package to test importing
-SKIP: {
-    eval "use List::Util qw(reduce);";
-    skip 'No reduce() in List::Util', 2
-       if $@;
-
-    # use again to get the import()
-    use List::Util qw(reduce);
-    {
-       my $fail = 0;
-       my $ret = reduce {
-           version->parse($a);
-           $fail++ unless defined $a;
-           1
-       } "0.039", "0.035";
-       is $fail, 0, 'reduce() with parse';
+BEGIN {
+    eval "use List::Util qw(reduce)";
+    if ($@) {
+       plan skip_all => "No List::Util::reduce() available";
+    } else {
+       plan tests => 3;
     }
+}
 
-    {
-       my $fail = 0;
-       my $ret = reduce {
-           version->qv($a);
-           $fail++ unless defined $a;
-           1
-       } "0.039", "0.035";
-       is $fail, 0, 'reduce() with qv';
-    }
+# do strict lax tests in a sub to isolate a package to test importing
+# use again to get the import()
+use List::Util qw(reduce);
+{
+    my $fail = 0;
+    my $ret = reduce {
+       version->parse($a);
+       $fail++ unless defined $a;
+       1
+    } "0.039", "0.035";
+    is $fail, 0, 'reduce() with parse';
+}
+
+{
+    my $fail = 0;
+    my $ret = reduce {
+       version->qv($a);
+       $fail++ unless defined $a;
+       1
+    } "0.039", "0.035";
+    is $fail, 0, 'reduce() with qv';
 }