xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/ext/IO/t/io_const.t (revision 0:68f95e015346)
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}
34