Permalink
Browse files

Add tests for 'p' and 'x' commands without subsequent whitespace.

Tests pass on perl-5.16.3 but should fail (until source code is corrected) on
subsequent versions.

For: RT #120174
  • Loading branch information...
jkeenan authored and arc committed Sep 3, 2017
1 parent 7fdd4f0 commit 582a8ad99532af5c8db4e42c8880618fbce41c6d
Showing with 90 additions and 1 deletion.
  1. +1 −0 MANIFEST
  2. +85 −1 lib/perl5db.t
  3. +4 −0 lib/perl5db/t/rt-120174
View
@@ -4607,6 +4607,7 @@ lib/perl5db/t/lvalue-bug Tests for the Perl debugger
lib/perl5db/t/MyModule.pm Tests for the Perl debugger
lib/perl5db/t/proxy-constants Tests for the Perl debugger
lib/perl5db/t/rt-104168 Tests for the Perl debugger
lib/perl5db/t/rt-120174 Tests for the Perl debugger
lib/perl5db/t/rt-121509-restart-after-chdir Tests for the Perl debugger
lib/perl5db/t/rt-61222 Tests for the Perl debugger
lib/perl5db/t/rt-66110 Tests for the Perl debugger
View
@@ -31,7 +31,7 @@ BEGIN {
$ENV{PERL_RL} = 'Perl'; # Suppress system Term::ReadLine::Gnu
}
plan(123);
plan(127);
my $rc_filename = '.perldb';
@@ -2817,6 +2817,90 @@ SKIP:
);
}
{
# perl 5 RT #120174 - 'p' command
my $wrapper = DebugWrap->new(
{
cmds =>
[
'b 2',
'c',
'p@abc',
'q',
],
prog => '../lib/perl5db/t/rt-120174',
}
);
$wrapper->contents_like(
qr/1234/,
q/RT 120174: p command can be invoked without space after 'p'/,
);
}
{
# perl 5 RT #120174 - 'x' command on array
my $wrapper = DebugWrap->new(
{
cmds =>
[
'b 2',
'c',
'x@abc',
'q',
],
prog => '../lib/perl5db/t/rt-120174',
}
);
$wrapper->contents_like(
qr/0\s+1\n1\s+2\n2\s+3\n3\s+4/ms,
q/RT 120174: x command can be invoked without space after 'x' before array/,
);
}
{
# perl 5 RT #120174 - 'x' command on array ref
my $wrapper = DebugWrap->new(
{
cmds =>
[
'b 2',
'c',
'x\@abc',
'q',
],
prog => '../lib/perl5db/t/rt-120174',
}
);
$wrapper->contents_like(
qr/\s+0\s+1\n\s+1\s+2\n\s+2\s+3\n\s+3\s+4/ms,
q/RT 120174: x command can be invoked without space after 'x' before array ref/,
);
}
{
# perl 5 RT #120174 - 'x' command on hash ref
my $wrapper = DebugWrap->new(
{
cmds =>
[
'b 4',
'c',
'x\%xyz',
'q',
],
prog => '../lib/perl5db/t/rt-120174',
}
);
$wrapper->contents_like(
qr/\s+'alpha'\s+=>\s+'beta'\n\s+'gamma'\s+=>\s+'delta'/ms,
q/RT 120174: x command can be invoked without space after 'x' before hash ref/,
);
}
END {
1 while unlink ($rc_filename, $out_fn);
}
View
@@ -0,0 +1,4 @@
@abc = (1..4);
print "hello world\n";
%xyz = ( 'alpha' => 'beta', 'gamma' => 'delta' );
print "goodbye world\n";

0 comments on commit 582a8ad

Please sign in to comment.