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    no strict 'refs';
18    my $d1 = defined(&{"IO::Handle::" . $_}) ? 1 : 0;
19    my $v1 = $d1 ? &{"IO::Handle::" . $_}() : undef;
20    my $v2 = IO::Handle::constant($_);
21    my $d2 = defined($v2);
22
23    print "not "
24	if($d1 != $d2 || ($d1 && ($v1 != $v2)));
25    print "ok ",$i++,"\n";
26}
27