source: trunk/essentials/dev-lang/perl/ext/IO/t/io_const.t

Last change on this file was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 667 bytes
Line 
1
2BEGIN {
3 unless(grep /blib/, @INC) {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 }
7}
8
9use Config;
10
11BEGIN {
12 if($ENV{PERL_CORE}) {
13 if ($Config{'extensions'} !~ /\bIO\b/) {
14 print "1..0 # Skip: IO extension not compiled\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}
Note: See TracBrowser for help on using the repository browser.