require.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
BEGIN {
chdir 't' if -d 't';
}
# don't make this lexical
$i = 1;
# Tests 21 .. 23 work only with non broken UTF16-as-code implementations,
# i.e. not EBCDIC Perls.
if ($Is_EBCDIC) {
print "1..20\n";
}
else {
print "1..23\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";
{
use utf8;
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;
exit if $Is_EBCDIC;
# UTF-encoded things
sub bytes_to_utf16 {
}
# ***interaction with pod (don't put any thing after here)***
=pod