The warning no more comes from util.c, it comes from numeric.c.
[p5sagit/p5-mst-13.2.git] / ext / List / Util / t / maxstr.t
1 BEGIN {
2         chdir 't' if -d 't';
3         @INC = '../lib';
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         }
9 }
10
11 use List::Util qw(maxstr);
12
13 print "1..5\n";
14
15 print "not " unless defined &maxstr;
16 print "ok 1\n";
17
18 print "not " unless maxstr('a') eq 'a';
19 print "ok 2\n";
20
21 print "not " unless maxstr('a','b') eq 'b';
22 print "ok 3\n";
23
24 print "not " unless maxstr('B','A') eq 'B';
25 print "ok 4\n";
26
27 my @a = map { pack("u", pack("C*",map { int(rand(256))} (0..int(rand(10) + 2)))) } 0 .. 20;
28 my @b = sort { $a cmp $b } @a;
29 print "not " unless maxstr(@a) eq $b[-1];
30 print "ok 5\n";