Skip to content

Commit

Permalink
Add eval test case that had previously failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocky Bernstein committed Dec 31, 2011
1 parent e6bb38e commit fa4a122
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Eval.pm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sub run($$)
$expr = $proc->{cmd_argstr};
}
{
my $opts->{return_type} = parse_eval_suffix($cmd_name);
my $opts = {return_type => parse_eval_suffix($cmd_name)};
no warnings 'once';
$proc->evaluate($expr, $opts);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ sub run($$)
if (exists($DB::dbline{$lineno}) and
my $brkpts = $DB::dbline{$lineno}) {
my $found = 0;
for my $bp (@{$brkpts}) {
for my $bp (@{$brkpts}) {
if (defined($bp)) {
$a_pad = sprintf('%02d', $bp->id);
$s .= $bp->icon_char;
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Watch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub run($$) {
# FIXME: handle someday...
# my $cmd_name = $args->[0];
# my $opts->{return_type} = parse_eval_suffix($cmd_name);
my $opts->{return_type} = '$';
my $opts = {return_type => '$'};
my $mess = sprintf("Watch expression %d `%s' set", $wp->id, $expr);
$proc->msg($mess);
$proc->evaluate($expr, $opts);
Expand Down
2 changes: 2 additions & 0 deletions t/data/eval.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set auto eval on
@ARGV
@ @ARGV
$ @ARGV
# An eval with no sigil. We once had a bug here
use English
eval 3+4
# Check that "my" variables can be evaluated properly
c gcd
Expand Down
9 changes: 5 additions & 4 deletions t/data/eval.right
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ $DB::D[1] =
$DB::D[2] =
@{$VAR1 = [ '3', '5' ];}
$DB::D[3] = 2
$DB::D[4] = $VAR1 = 7;
$DB::D[4] = $VAR1 = 0;
$DB::D[5] = $VAR1 = 7;
x1 (gcd.pl:9)
my ($a, $b) = @_;
-- (gcd.pl:11)
($a, $b) = ($b, $a) if ($a > $b);
$DB::D[5] = 3
$DB::D[6] = 5
$DB::D[7] =
$DB::D[6] = 3
$DB::D[7] = 5
$DB::D[8] =
@{$VAR1 = [ '3', '5' ];}

0 comments on commit fa4a122

Please sign in to comment.