Commit | Line | Data |
---|---|---|
c0f790df GB |
1 | #!./perl |
2 | ||
3 | BEGIN { | |
4 | unless (-d 'blib') { | |
5 | chdir 't' if -d 't'; | |
6 | @INC = '../lib'; | |
7 | require Config; import Config; | |
8 | keys %Config; # Silence warning | |
9 | if ($Config{extensions} !~ /\bList\/Util\b/) { | |
10 | print "1..0 # Skip: List::Util was not built\n"; | |
11 | exit 0; | |
12 | } | |
13 | } | |
14 | } | |
15 | ||
16 | ||
17 | use Scalar::Util qw(openhandle); | |
18 | ||
19 | print "1..4\n"; | |
20 | ||
21 | print "not " unless defined &openhandle; | |
22 | print "ok 1\n"; | |
23 | ||
24 | my $fh = \*STDERR; | |
25 | print "not " unless openhandle($fh) == $fh; | |
26 | print "ok 2\n"; | |
27 | ||
28 | print "not " unless fileno(openhandle(*STDERR)) == fileno(STDERR); | |
29 | print "ok 3\n"; | |
30 | ||
31 | print "not " if openhandle(CLOSED); | |
32 | print "ok 4\n"; | |
33 |