require.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
BEGIN {
chdir 't' if -d 't';
}
# don't make this lexical
$i = 1;
my $total_tests = 30;
if ($Is_EBCDIC || $Is_UTF8) { $total_tests = 27; }
print "1..$total_tests\n";
sub do_require {
my @a; # magic guard for scope violations (must be first lexical in file)
}
sub write_file {
my $f = shift;
use bytes;
print REQ @_;
}
eval {require 5.005};
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
eval { require 5.005 };
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
eval { require 5.005; };
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
eval {
require 5.005
};
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
# new style version numbers
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
eval { require 10.0.2; };
print "ok ",$i++,"\n";
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
eval q{ use 10.0.2; };
print "ok ",$i++,"\n";
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
# check inaccurate fp
$ver = 10.2;
print "ok ",$i++,"\n";
print "ok ",$i++,"\n";
print "ok ",$i++,"\n";
{
print "ok ",$i++,"\n";
print "ok ",$i++,"\n";
print "not "
print "ok ",$i++,"\n";
}
# interaction with pod (see the eof)
$i++;
# run-time failure in require
print "ok ",$i++,"\n";
# compile-time failure in require
# bison says 'parse error' instead of 'syntax error',
# various yaccs may or may not capitalize 'syntax'.
print "ok ",$i++,"\n";
# successful require
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
# do FILE shouldn't see any outside lexicals
my $x = "ok $i\n";
\$x = "not ok $i\\n";
EOT
print $x;
# Test that scalar context is forced for require
print "ok $i - require() context\n";
1;
**BLEAH**
);
eval {require bleah};
# UTF-encoded things - skipped on EBCDIC machines and on UTF-8 input
sub bytes_to_utf16 {
}
# ***interaction with pod (don't put any thing after here)***
=pod