This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
test for i Foo failing to load mro
authorTony Cook <tony@develop-help.com>
Mon, 23 Mar 2020 00:47:24 +0000 (11:47 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 23 Mar 2020 01:00:39 +0000 (12:00 +1100)
test for #17660

MANIFEST
lib/perl5db.t
lib/perl5db/t/gh-17660 [new file with mode: 0644]

index c43a51b..11203ce 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -4802,6 +4802,7 @@ lib/perl5db/t/EnableModule.pm     Tests for the Perl debugger
 lib/perl5db/t/eval-line-bug    Tests for the Perl debugger
 lib/perl5db/t/fact             Tests for the Perl debugger
 lib/perl5db/t/filename-line-breakpoint         Tests for the Perl debugger
 lib/perl5db/t/eval-line-bug    Tests for the Perl debugger
 lib/perl5db/t/fact             Tests for the Perl debugger
 lib/perl5db/t/filename-line-breakpoint         Tests for the Perl debugger
+lib/perl5db/t/gh-17660         Tests for the Perl debugger
 lib/perl5db/t/load-modules     Tests for the Perl debugger
 lib/perl5db/t/lsub-n           Test script used by perl5db.t
 lib/perl5db/t/lvalue-bug       Tests for the Perl debugger
 lib/perl5db/t/load-modules     Tests for the Perl debugger
 lib/perl5db/t/lsub-n           Test script used by perl5db.t
 lib/perl5db/t/lvalue-bug       Tests for the Perl debugger
index 450f4d0..421229a 100644 (file)
@@ -2899,6 +2899,31 @@ SKIP:
     );
 }
 
     );
 }
 
+{
+    # gh #17660
+    my $wrapper = DebugWrap->new(
+        {
+            cmds =>
+            [
+                'b 13',
+                'c',
+                'i Foo',
+                'q',
+            ],
+            prog => '../lib/perl5db/t/gh-17660',
+        }
+    );
+
+    $wrapper->output_unlike(
+        qr/Undefined subroutine &mro::get_linear_isa/ms,
+        q/mro needs to be loaded/,
+       );
+    $wrapper->output_like(
+        qr/Foo 1.000, Bar 2.000/,
+        q/check for reasonable result/,
+       );
+}
+
 SKIP:
 {
     $Config{usethreads}
 SKIP:
 {
     $Config{usethreads}
diff --git a/lib/perl5db/t/gh-17660 b/lib/perl5db/t/gh-17660
new file mode 100644 (file)
index 0000000..a818f79
--- /dev/null
@@ -0,0 +1,14 @@
+#!perl
+
+package Bar;
+our $VERSION = "2.000";
+
+sub f {}
+
+package Foo;
+our @ISA = qw(Bar);
+our $VERSION = "1.000";
+
+package main;
+Foo->f();
+