xref: /openbsd/gnu/usr.bin/perl/dist/IO/t/io_const.t (revision 73471bf0)
1use Config;
2
3BEGIN {
4    if($ENV{PERL_CORE}) {
5        if ($Config{'extensions'} !~ /\bIO\b/) {
6            print "1..0 # Skip: IO extension not compiled\n";
7            exit 0;
8        }
9    }
10}
11
12use IO::Handle;
13
14print "1..6\n";
15my $i = 1;
16foreach (qw(SEEK_SET SEEK_CUR SEEK_END     _IOFBF    _IOLBF    _IONBF)) {
17    my $d1 = defined(&{"IO::Handle::" . $_}) ? 1 : 0;
18    my $v1 = $d1 ? &{"IO::Handle::" . $_}() : undef;
19    my $v2 = IO::Handle::constant($_);
20    my $d2 = defined($v2);
21
22    print "not "
23	if($d1 != $d2 || ($d1 && ($v1 != $v2)));
24    print "ok ",$i++,"\n";
25}
26