diff --git a/MANIFEST b/MANIFEST index a2c179626b5d..b0593d929392 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2558,6 +2558,7 @@ lib/parent/t/parent.t tests for parent.pm lib/perl5db.pl Perl debugging routines lib/perl5db.t Tests for the Perl debugger lib/perl5db/t/eval-line-bug Tests for the Perl debugger +lib/perl5db/t/lvalue-bug Tests for the Perl debugger lib/PerlIO.pm PerlIO support module lib/PerlIO/via/QuotedPrint.pm PerlIO::via::QuotedPrint lib/PerlIO/via/t/QuotedPrint.t PerlIO::via::QuotedPrint diff --git a/lib/perl5db.t b/lib/perl5db.t index 2cf7958d3396..22a8271c5e7b 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -26,7 +26,7 @@ my $dev_tty = '/dev/tty'; } } -plan(1); +plan(2); sub rc { open RC, ">", ".perldb" or die $!; @@ -76,6 +76,13 @@ like($contents, qr/sub factorial/, 'The ${main::_ [ '-d' ], progfile => '../lib/perl5db/t/lvalue-bug'); + like($output, qr/foo is defined/, 'lvalue subs work in the debugger'); +} + # clean up. END { diff --git a/lib/perl5db/t/lvalue-bug b/lib/perl5db/t/lvalue-bug new file mode 100644 index 000000000000..14d2fbbfb008 --- /dev/null +++ b/lib/perl5db/t/lvalue-bug @@ -0,0 +1,9 @@ +#!/usr/bin/perl +# +# This code is used by lib/perl5db.t !!! +# + +my $i; +sub foo () : lvalue { $i } +foo = 1; +print defined foo ? "foo is defined" : "foo is still undef", "\n";