This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fixes test case failure introduced by #12071, the warning is
[perl5.git] / ext / IO / lib / IO / t / io_const.t
CommitLineData
cf7fe8a2
GS
1
2BEGIN {
3 unless(grep /blib/, @INC) {
4 chdir 't' if -d 't';
20822f61 5 @INC = '../lib';
cf7fe8a2
GS
6 }
7}
8
9use Config;
10
11BEGIN {
12 if(-d "lib" && -f "TEST") {
13 if ($Config{'extensions'} !~ /\bIO\b/ && $^O ne 'VMS') {
14 print "1..0\n";
15 exit 0;
16 }
17 }
18}
19
20use IO::Handle;
21
22print "1..6\n";
23my $i = 1;
24foreach (qw(SEEK_SET SEEK_CUR SEEK_END _IOFBF _IOLBF _IONBF)) {
25 my $d1 = defined(&{"IO::Handle::" . $_}) ? 1 : 0;
26 my $v1 = $d1 ? &{"IO::Handle::" . $_}() : undef;
27 my $v2 = IO::Handle::constant($_);
28 my $d2 = defined($v2);
29
30 print "not "
31 if($d1 != $d2 || ($d1 && ($v1 != $v2)));
32 print "ok ",$i++,"\n";
33}