More DWIMminess for Class::Struct: calling the array or hash
[p5sagit/p5-mst-13.2.git] / t / lib / u-first.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(first);
12
13print "1..4\n";
14
15print "not " unless defined &first;
16print "ok 1\n";
17
18print "not " unless 9 == first { 8 == ($_ - 1) } 9,4,5,6;
19print "ok 2\n";
20
21print "not " if defined(first { 0 } 1,2,3,4);
22print "ok 3\n";
23
24print "not " if defined(first { 0 });
25print "ok 4\n";