summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST2
-rw-r--r--dist/base/lib/base.pm4
-rw-r--r--dist/base/t/base-open-chunk.t14
-rw-r--r--dist/base/t/base-open-line.t12
4 files changed, 30 insertions, 2 deletions
diff --git a/MANIFEST b/MANIFEST
index efa172daed..6611b88b56 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2831,6 +2831,8 @@ dist/base/lib/base.pm Establish IS-A relationship at compile time
dist/base/lib/fields.pm Set up object field names for pseudo-hash-using classes
dist/base/MANIFEST base.pm manifest
dist/base/META.yml base.pm META.yml file
+dist/base/t/base-open-chunk.t See if base works
+dist/base/t/base-open-line.t See if base works
dist/base/t/base.t See if base works
dist/base/t/compile-time.t See if base works
dist/base/t/fields-5_6_0.t See if fields work
diff --git a/dist/base/lib/base.pm b/dist/base/lib/base.pm
index 36ae2a5540..99bda20e77 100644
--- a/dist/base/lib/base.pm
+++ b/dist/base/lib/base.pm
@@ -107,8 +107,8 @@ sub import {
# probably be using parent.pm, which doesn't try to
# guess whether require is needed or failed,
# see [perl #118561]
- die if $@ && $@ !~ /^Can't locate \Q$fn\E .*? at \Q$file\E line \Q$line\E\.\n\z/s
- || $@ =~ /Compilation failed in require at \Q$file\E line \Q$line\E\.\n\z/;
+ die if $@ && $@ !~ /^Can't locate \Q$fn\E .*? at \Q$file\E line \Q$line\E(?:, <[^>]*> (?:line|chunk) [0-9]+)?\.\n\z/s
+ || $@ =~ /Compilation failed in require at \Q$file\E line \Q$line\E(?:, <[^>]*> (?:line|chunk) [0-9]+)?\.\n\z/;
unless (%{"$base\::"}) {
require Carp;
local $" = " ";
diff --git a/dist/base/t/base-open-chunk.t b/dist/base/t/base-open-chunk.t
new file mode 100644
index 0000000000..ef6c25d201
--- /dev/null
+++ b/dist/base/t/base-open-chunk.t
@@ -0,0 +1,14 @@
+#!/usr/bin/perl -w
+
+my $file = __FILE__;
+
+open my $fh, '<', $file or die "Can't open $file: $!";
+$/ = \1;
+<$fh>;
+(my $test_file = $file) =~ s/-open-chunk//;
+
+unless (my $return = do $test_file) {
+ warn "couldn't parse $test_file: $@" if $@;
+ warn "couldn't do $test_file: $!" unless defined $return;
+ warn "couldn't run $test_file" unless $return;
+}
diff --git a/dist/base/t/base-open-line.t b/dist/base/t/base-open-line.t
new file mode 100644
index 0000000000..ce6cf1538d
--- /dev/null
+++ b/dist/base/t/base-open-line.t
@@ -0,0 +1,12 @@
+#!/usr/bin/perl -w
+
+my $file = __FILE__;
+open my $fh, '<', $file or die "Can't open $file: $!";
+<$fh>;
+(my $test_file = $file) =~ s/-open-line//;
+
+unless (my $return = do $test_file) {
+ warn "couldn't parse $test_file: $@" if $@;
+ warn "couldn't do $test_file: $!" unless defined $return;
+ warn "couldn't run $test_file" unless $return;
+}