Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test |@A and |%h interpolation in \(...).
  • Loading branch information
jnthn committed Mar 30, 2015
1 parent 194f336 commit 7e3870b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion S02-types/capture.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 19;
plan 21;

{
my $capture = \(1,2,3);
Expand Down Expand Up @@ -103,6 +103,23 @@ plan 19;
"mixing ordinary args with captures (2)";
}

{
my @a = 1, 2;
my $capture = \(|@a,3);
sub foo10 ($a, $b, $c) { "$a!$b!$c" }
is foo10(|$capture), "1!2!3",
'|@a interpolation into \(...) works';
}

{
my %h = named => 'arg';
my $capture = \(1, |%h);

sub foo11 ($a, :$named) { "$a!$named" }
is foo11(|$capture), "1!arg",
'|%h interpolation into \(...) works';
}

{
# RT #78496
my $c = ('OH' => 'HAI').Capture;
Expand Down

0 comments on commit 7e3870b

Please sign in to comment.