Add Scalar-List-Utils 1.02, from Graham Barr.
[p5sagit/p5-mst-13.2.git] / t / lib / u-reduce.t
1 BEGIN {
2         chdir 't' if -d 't';
3         @INC = '../lib';
4 }
5
6 use List::Util qw(reduce min);
7
8 print "1..5\n";
9
10 print "not " if defined reduce {};
11 print "ok 1\n";
12
13 print "not " unless 9 == reduce { $a / $b } 756,3,7,4;
14 print "ok 2\n";
15
16 print "not " unless 9 == reduce { $a / $b } 9;
17 print "ok 3\n";
18
19 @a = map { rand } 0 .. 20;
20 print "not " unless min(@a) == reduce { $a < $b ? $a : $b } @a;
21 print "ok 4\n";
22
23 @a = map { pack("C", int(rand(256))) } 0 .. 20;
24 print "not " unless join("",@a) eq reduce { $a . $b } @a;
25 print "ok 5\n";