From 50acbf3bbd1afcaf915d749b17bd75e286248794 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 15 Nov 2012 17:54:26 +0200 Subject: Add a testcase for the bug. It is caused by $obj spontaneously becoming undef for no good reason - seems like a bug in the perl interpreter (or elsewhere). This was noticed by Father C here: https://rt.perl.org/rt3/Ticket/Display.html?id=114926 --- lib/perl5db.t | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/perl5db.t') diff --git a/lib/perl5db.t b/lib/perl5db.t index b021ffe78c..e2efa25fc6 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -798,6 +798,30 @@ sub _calc_trace_wrapper ); } +# Tests for x with AutoTrace=1. +{ + my $wrapper = DebugWrap->new( + { + cmds => + [ + 'n', + 'o AutoTrace=1', + # So it may fail. + q/x "failure"/, + q/x \$x/, + 'q', + ], + prog => '../lib/perl5db/t/with-subroutine', + } + ); + + $wrapper->contents_like( + # qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/, + qr/^0\sSCALAR\([^\)]+\)\n\s+-> 'hello world'\n/ms, + "x after AutoTrace=1 command is working." + ); +} + # Tests for "T" (stack trace). { my $prog_fn = '../lib/perl5db/t/rt-104168'; -- cgit v1.2.1