Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test for flattening positional arg.
  • Loading branch information
jnthn committed Jan 12, 2013
1 parent 43ac52b commit 4f97253
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion t/qast_arguments.t
@@ -1,6 +1,6 @@
use helper;

plan(7);
plan(8);

qast_test(
-> {
Expand Down Expand Up @@ -267,3 +267,41 @@ qast_test(
},
"3\n5\n6.5\nVenison\n",
"Slurpy named parameters");

qast_test(
-> {
my $block := QAST::Block.new(
QAST::Stmts.new(
QAST::Op.new(
:op('bind'),
QAST::Var.new( :name('&many_things'), :scope('lexical'), :decl('var') ),
QAST::Block.new(
QAST::Op.new(
:op('say'),
QAST::Var.new( :name('a'), :scope('local'), :decl('param'), :returns(int) )
),
QAST::Op.new(
:op('say'),
QAST::Var.new( :name('b'), :scope('local'), :decl('param'), :returns(num) )
),
QAST::Op.new(
:op('say'),
QAST::Var.new( :name('c'), :scope('local'), :decl('param'), :returns(str) )
))),
QAST::Op.new(
:op('call'), :name('&many_things'),
QAST::Op.new(
:op('list'), :flat(1),
QAST::IVal.new( :value(25) ),
QAST::NVal.new( :value(6.9) ),
QAST::SVal.new( :value('Karai') )
))));
QAST::CompUnit.new(
$block,
:main(QAST::Op.new(
:op('call'),
QAST::BVal.new( :value($block) )
)))
},
"25\n6.9\nKarai\n",
"Flattening positional arguments");

0 comments on commit 4f97253

Please sign in to comment.