Commit | Line | Data |
---|---|---|
95a23f5d JP |
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 | ||
6 | use strict; | |
d3a5b29c | 7 | use_ok("version", 0.9921); |
effa684c | 8 | use Test::More; |
95a23f5d | 9 | |
effa684c JP |
10 | BEGIN { |
11 | eval "use List::Util qw(reduce)"; | |
12 | if ($@) { | |
13 | plan skip_all => "No List::Util::reduce() available"; | |
14 | } else { | |
15 | plan tests => 3; | |
95a23f5d | 16 | } |
effa684c | 17 | } |
95a23f5d | 18 | |
effa684c JP |
19 | # do strict lax tests in a sub to isolate a package to test importing |
20 | # use again to get the import() | |
21 | use 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'; | |
95a23f5d | 40 | } |