Commit | Line | Data |
f4a2945e |
1 | BEGIN { |
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 | |
11 | use List::Util qw(first); |
12 | |
13 | print "1..4\n"; |
14 | |
15 | print "not " unless defined &first; |
16 | print "ok 1\n"; |
17 | |
18 | print "not " unless 9 == first { 8 == ($_ - 1) } 9,4,5,6; |
19 | print "ok 2\n"; |
20 | |
21 | print "not " if defined(first { 0 } 1,2,3,4); |
22 | print "ok 3\n"; |
23 | |
24 | print "not " if defined(first { 0 }); |
25 | print "ok 4\n"; |