Skip to content

Commit

Permalink
Add test for RT #118063
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Oct 15, 2014
1 parent 9186415 commit 4485db4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S06-signature/defaults.t
Expand Up @@ -10,7 +10,7 @@ Tests assigning default values to variables of type code in sub definitions.

# L<S06/Optional parameters/Default values can be calculated at run-time>

plan 5;
plan 7;

sub doubler($x) { return 2 * $x }

Expand Down Expand Up @@ -47,4 +47,14 @@ ok((MyPack::val_v), "default sub called in package namespace");
is rt69200(:x), True, '":x" is the same as "x => True" in sub call';
}

# RT #118063
{
sub a ( $a=1 --> Hash ) { my %h = ($a => "foo") };
ok a(2)<2> :exists,
'no comma required between parameter with default value and returns-arrow ("-->")';
sub b ( $b=1, --> Hash ) { my %h = ($b => "foo") };
ok b(2)<2> :exists,
'comma allowed between parameter with default value and returns-arrow ("-->")';
}

# vim: ft=perl6

0 comments on commit 4485db4

Please sign in to comment.