Skip to content

Commit

Permalink
[js] Test a QAST::Var with a 'param' decl and children nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Sep 28, 2016
1 parent 2c16625 commit e14ebce
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion t/qast/01-qast.t
@@ -1,6 +1,6 @@
use QAST;

plan(77);
plan(78);

# Following a test infrastructure.
sub compile_qast($qast) {
Expand Down Expand Up @@ -1233,3 +1233,26 @@ test_qast_result(
ok(!$dont_call, 'nqp::chain shortcircuits');
}
);

if nqp::getcomp('nqp').backend.name eq 'jvm' {
skip('children of a QAST::Var with a "param" decl are not implemented');
}
else {
is_qast_args(
QAST::Block.new(
QAST::Var.new( :name('other'), :scope('local'), :decl('var')),
QAST::Var.new( :name('arg'), :scope('local'), :decl('param'), :returns(str),
QAST::Op.new( :op('bind'),
QAST::Var.new( :name('other'), :scope('local')),
QAST::Op.new(:op<concat>,
QAST::SVal.new(:value<Mmmmm...>),
QAST::Var.new( :name('arg'), :scope('local')),
)
)
),
QAST::Var.new( :name('other'), :scope('local'))
),
['Highland Park!'],
'Mmmmm...Highland Park!',
'a QAST::Var with a param decl can have children which are executed');
}

0 comments on commit e14ebce

Please sign in to comment.