4 require Config; import Config;
5 if ($Config{extensions} !~ /\bList\/Util\b/) {
6 print "1..0 # Skip: List::Util was not built\n";
11 use List::Util qw(maxstr);
15 print "not " unless defined &maxstr;
18 print "not " unless maxstr('a') eq 'a';
21 print "not " unless maxstr('a','b') eq 'b';
24 print "not " unless maxstr('B','A') eq 'B';
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];