Skip to content

Commit

Permalink
Test for parameters bound into lexicals also.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jan 13, 2013
1 parent f7b919c commit 93693b2
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion t/qast_arguments.t
@@ -1,6 +1,6 @@
use helper;

plan(12);
plan(13);

qast_test(
-> {
Expand Down Expand Up @@ -88,6 +88,36 @@ qast_test(
},
"42\n",
"Integer arguments and return value");

qast_test(
-> {
my $block := QAST::Block.new(
QAST::Stmts.new(
QAST::Op.new(
:op('bind'),
QAST::Var.new( :name('&add'), :scope('lexical'), :decl('var') ),
QAST::Block.new(
QAST::Op.new(
:op('add_i'),
QAST::Var.new( :name('a_param'), :scope('lexical'), :decl('param'), :returns(int) ),
QAST::Var.new( :name('b_param'), :scope('lexical'), :decl('param'), :returns(int) )
))),
QAST::Op.new(
:op('say'),
QAST::Op.new(
:op('call'), :name('&add'), :returns(int),
QAST::IVal.new( :value(39) ),
QAST::IVal.new( :value(3) )
))));
QAST::CompUnit.new(
$block,
:main(QAST::Op.new(
:op('call'),
QAST::BVal.new( :value($block) )
)))
},
"42\n",
"Integer arguments and return value (lexical)");

qast_test(
-> {
Expand Down

0 comments on commit 93693b2

Please sign in to comment.