Permalink
Browse files

added test for call to block with slurpy

The functionality was already there.
  • Loading branch information...
1 parent cd60db0 commit 2b55922b389cd27fb7c5872569add143f6f15316 @masak masak committed May 26, 2012
Showing with 29 additions and 0 deletions.
  1. +4 −0 src/QAST/Compiler.nqp
  2. +25 −0 t/qast/qast.t
View
@@ -464,6 +464,10 @@ class QAST::Compiler is HLL::Compiler {
# both registers and literals.
return $post;
}
+ elsif $result eq 'p' && $desired eq 'P' {
+ # <jnthn> Hmm...lowercase p doesn't make any sense
+ return $post;
+ }
else {
pir::die("Coercion from '$result' to '$desired' NYI");
}
View
@@ -790,3 +790,28 @@ is_qast(
'DDD, greg',
'callmethod with named arguments works');
+{
+ my $elems := QAST::Block.new(
+ QAST::Var.new( :name('array'), :slurpy, :scope('local'), :decl('param') ),
+ QAST::Op.new(
+ :op('elems'),
+ QAST::Var.new( :name('array'), :scope('local') ),
+ ),
+ );
+
+ is_qast(
+ QAST::Block.new(
+ $elems,
+ QAST::Op.new(
+ :op('call'),
+ QAST::BVal.new( :value($elems) ),
+ QAST::IVal.new( :value(1) ),
+ QAST::IVal.new( :value(2) ),
+ QAST::IVal.new( :value(3) ),
+ QAST::IVal.new( :value(4) ),
+ )
+ ),
+ 4,
+ 'call to block with slurpy parameter works');
+}
+

0 comments on commit 2b55922

Please sign in to comment.