Skip to content

Commit

Permalink
Test deeper trees with :combine.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcurtis committed Aug 9, 2010
1 parent c7ba4aa commit b608fde
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion t/tree-optimizer.t
Expand Up @@ -2,7 +2,7 @@

pir::load_bytecode('Tree/Optimizer.pbc');

plan(33);
plan(37);

{
my $opt := Tree::Optimizer.new;
Expand Down Expand Up @@ -209,6 +209,17 @@ pir::load_bytecode('PAST/Pattern.pbc');
':combine produces same result as without it.');
ok($pattern.count == 2,
'With :combine, .transform is not called.');
$past := PAST::Stmts.new(PAST::Val.new(:value(6)));
$target := PAST::Pattern::Stmts.new(PAST::Pattern::Val.new(:value(14)));
ok($opt.run($past.clone) ~~ $target,
'Second :combine test optimizer runs correctly without combine.');
ok($pattern.count == 4,
'Second :combine test optimizer calls .transform twice without :combine.');
$past := PAST::Stmts.new(PAST::Val.new(:value(6)));
ok($opt.run($past.clone, :combine(1)) ~~ $target,
':combine produces same result as without it for second test optimizer.');
ok($pattern.count == 4,
'With :combine, .transform is not called with second test optimizer.');
}

{
Expand Down

0 comments on commit b608fde

Please sign in to comment.