blob: 44ab51bfcc36f8f6b3f8e0d8cf762aed21b7e1e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#########################
use strict;
use_ok("version", 0.9920);
use Test::More;
BEGIN {
eval "use List::Util qw(reduce)";
if ($@) {
plan skip_all => "No List::Util::reduce() available";
} else {
plan tests => 3;
}
}
# 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';
}
|