summaryrefslogtreecommitdiff
path: root/t/comp/use.t
diff options
context:
space:
mode:
Diffstat (limited to 't/comp/use.t')
-rwxr-xr-xt/comp/use.t17
1 files changed, 16 insertions, 1 deletions
diff --git a/t/comp/use.t b/t/comp/use.t
index fb597770d0..e0281b4d20 100755
--- a/t/comp/use.t
+++ b/t/comp/use.t
@@ -5,7 +5,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..27\n";
+print "1..28\n";
my $i = 1;
eval "use 5.000"; # implicit semicolon
@@ -168,3 +168,18 @@ print "ok ",$i++,"\n";
}
print "ok ",$i++,"\n";
}
+
+
+{
+ # Regression test for patch 14937:
+ # Check that a .pm file with no package or VERSION doesn't core.
+ open F, ">xxx.pm" or die "Cannot open xxx.pm: $!\n";
+ print F "1;\n";
+ close F;
+ eval "use lib '.'; use xxx 3;";
+ unless ($@ =~ /^xxx defines neither package nor VERSION--version check failed at/) {
+ print "not ";
+ }
+ print "ok ",$i++,"\n";
+ unlink 'xxx.pm';
+}