This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Synch cpan/version/* and other files with CPAN version 0.9921.
[perl5.git] / cpan / version / t / 09_list_util.t
... / ...
CommitLineData
1# Before `make install' is performed this script should be runnable with
2# `make test'. After `make install' it should work as `perl test.pl'
3
4#########################
5
6use strict;
7use_ok("version", 0.9921);
8use Test::More;
9
10BEGIN {
11 eval "use List::Util qw(reduce)";
12 if ($@) {
13 plan skip_all => "No List::Util::reduce() available";
14 } else {
15 plan tests => 3;
16 }
17}
18
19# do strict lax tests in a sub to isolate a package to test importing
20# use again to get the import()
21use List::Util qw(reduce);
22{
23 my $fail = 0;
24 my $ret = reduce {
25 version->parse($a);
26 $fail++ unless defined $a;
27 1
28 } "0.039", "0.035";
29 is $fail, 0, 'reduce() with parse';
30}
31
32{
33 my $fail = 0;
34 my $ret = reduce {
35 version->qv($a);
36 $fail++ unless defined $a;
37 1
38 } "0.039", "0.035";
39 is $fail, 0, 'reduce() with qv';
40}