Skip to content

Commit

Permalink
Tests for #92906: perl -d has non-functional b command
Browse files Browse the repository at this point in the history
In bleadperl (NOT perl-5.12.3) perl -d's "b" command does not appear
to do anything as verified on my x86-64 Mandriva Linux Cooker machine. This
patch adds a regression test to test for it.

See:

http://www.nntp.perl.org/group/perl.perl5.porters/2011/06/msg173568.html
  • Loading branch information
shlomif authored and Father Chrysostomos committed Jun 16, 2011
1 parent f34d156 commit 2211a10
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -3940,6 +3940,7 @@ lib/overload.pm Module for overloading perl operators
lib/overload.t See if operator overloading works
lib/perl5db.pl Perl debugging routines
lib/perl5db.t Tests for the Perl debugger
lib/perl5db/t/breakpoint-bug Test script used by perl5db.t
lib/perl5db/t/eval-line-bug Tests for the Perl debugger
lib/perl5db/t/lvalue-bug Tests for the Perl debugger
lib/perl5db/t/proxy-constants Tests for the Perl debugger
Expand Down
28 changes: 27 additions & 1 deletion lib/perl5db.t
Expand Up @@ -27,7 +27,7 @@ my $dev_tty = '/dev/tty';
}
}

plan(9);
plan(10);

sub rc {
open RC, ">", ".perldb" or die $!;
Expand Down Expand Up @@ -177,6 +177,32 @@ SKIP: {
is($output, '[$^X][done]', "taint");
}

# Testing that we can set a breakpoint
{
rc(<<'EOF');
&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
sub afterinit {
push (@DB::typeahead,
'b 6',
'c',
q/do { use IO::Handle; STDOUT->autoflush(1); print "X={$x}\n"; }/,
'c',
'q',
);
}
EOF

my $output = runperl(switches => [ '-d', ], stderr => 1, progfile => '../lib/perl5db/t/breakpoint-bug');

like($output, qr/
X=\{Two\}
/msx,
"Can set breakpoint in a line.");
}



# clean up.

Expand Down
8 changes: 8 additions & 0 deletions lib/perl5db/t/breakpoint-bug
@@ -0,0 +1,8 @@
#!/usr/bin/perl
my $x = "One";

$x = "Two";

my $y = "Lambda";

$x = "Four";

0 comments on commit 2211a10

Please sign in to comment.