Update to Scalar-List-Utils-1.15
[p5sagit/p5-mst-13.2.git] / ext / List / Util / t / openhan.t
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 use strict;
17 use vars qw(*CLOSED);
18 use Test::More tests => 4;
19 use Scalar::Util qw(openhandle);
20
21 ok(defined &openhandle, 'defined');
22
23 my $fh = \*STDERR;
24 is(openhandle($fh), $fh, 'STDERR');
25
26 is(fileno(openhandle(*STDERR)), fileno(STDERR), 'fileno(STDERR)');
27
28 is(openhandle(*CLOSED), undef, 'closed');
29