This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change to quiet cygwin's perlld
[perl5.git] / ext / List / Util / t / openhan.t
CommitLineData
c0f790df
GB
1#!./perl
2
3BEGIN {
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
17use Scalar::Util qw(openhandle);
18
19print "1..4\n";
20
21print "not " unless defined &openhandle;
22print "ok 1\n";
23
24my $fh = \*STDERR;
25print "not " unless openhandle($fh) == $fh;
26print "ok 2\n";
27
28print "not " unless fileno(openhandle(*STDERR)) == fileno(STDERR);
29print "ok 3\n";
30
31print "not " if openhandle(CLOSED);
32print "ok 4\n";
33