Skip to content
Permalink
Browse files

test feature behavior

  • Loading branch information...
dnmfarrell committed Jul 1, 2018
1 parent 66f4394 commit 66ee6057c84e8bcb50f73ed1a11c62df60277f58
Showing with 19 additions and 1 deletion.
  1. +19 −1 t/comp/require.t
@@ -34,7 +34,7 @@ if (grep -e, @files_to_delete) {

my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0;
my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/;
my $total_tests = 58;
my $total_tests = 60;
if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; }
print "1..$total_tests\n";

@@ -378,6 +378,24 @@ foreach (sort keys %templates) {
}
}

# feature require_false
{
print "# use feature 'require_false';\n";
use feature 'require_false';
write_file('bleah.pm', '0;');
%INC = ();
eval { require "bleah.pm" };
$i++;
print "not " if $@ =~ /did not return a true value/;
print "ok $i - require loads module returning 0\n";
write_file('bleah.pm', 'die "foobar";');
%INC = ();
eval { require "bleah.pm" };
$i++;
print "not " unless $@ =~ /foobar/;
print "ok $i - require throws compile error\n";
}

END {
foreach my $file (@files_to_delete) {
1 while unlink $file;

0 comments on commit 66ee605

Please sign in to comment.
You can’t perform that action at this time.