Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/src/cmd/perl/lib/IO/t/io_const.t

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



BEGIN {
    unless(grep /blib/, @INC) {
	chdir 't' if -d 't';
	@INC = '../lib';
    }
}

use Config;

BEGIN {
    if($ENV{PERL_CORE}) {
        if ($Config{'extensions'} !~ /\bIO\b/) {
            print "1..0 # Skip: IO extension not compiled\n";
            exit 0;
        }
    }
}

use IO::Handle;

print "1..6\n";
my $i = 1;
foreach (qw(SEEK_SET SEEK_CUR SEEK_END     _IOFBF    _IOLBF    _IONBF)) {
    my $d1 = defined(&{"IO::Handle::" . $_}) ? 1 : 0;
    my $v1 = $d1 ? &{"IO::Handle::" . $_}() : undef;
    my $v2 = IO::Handle::constant($_);
    my $d2 = defined($v2);

    print "not "
	if($d1 != $d2 || ($d1 && ($v1 != $v2)));
    print "ok ",$i++,"\n";
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].