Update to Text::Balanced 1.85.
[p5sagit/p5-mst-13.2.git] / t / lib / u-max.t
CommitLineData
f4a2945e 1BEGIN {
2 chdir 't' if -d 't';
3 @INC = '../lib';
6b05f64e 4 require Config; import Config;
5 if ($Config{extensions} !~ /\bList\/Util\b/) {
6 print "1..0 # Skip: List::Util was not built\n";
7 exit 0;
8 }
f4a2945e 9}
10
11use List::Util qw(max);
12
13print "1..5\n";
14
15print "not " unless defined &max;
16print "ok 1\n";
17
18print "not " unless max(1) == 1;
19print "ok 2\n";
20
21print "not " unless max(1,2) == 2;
22print "ok 3\n";
23
24print "not " unless max(2,1) == 2;
25print "ok 4\n";
26
27my @a = map { rand() } 1 .. 20;
28my @b = sort { $a <=> $b } @a;
29print "not " unless max(@a) == $b[-1];
30print "ok 5\n";