Permalink
Browse files

[t/spec] binding happens in parameter order

git-svn-id: http://svn.pugscode.org/pugs@28979 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 929d8e4 commit 82c4cad0572e42f63bb012ab928a5fda4c0ecc78 moritz committed Nov 3, 2009
Showing with 13 additions and 0 deletions.
  1. +13 −0 S06-signature/named-parameters.t
View
13 S06-signature/named-parameters.t
@@ -249,6 +249,19 @@ eval_dies_ok 'sub svn28865( :$a, :@a ) {}',
'parameter rename appears in .signature.perl' );
}
+# L<S06/Named parameters/Bindings happen in declaration order>
+{
+ my $t = '';
+ sub order_test($a where { $t ~= 'a' },
+ $b where { $t ~= 'b' },
+ $c where { $t ~= 'c' }) { 8 };
+ is order_test(c => 5, a => 3, b => 2), 8,
+ 'can fill positional by name';
+ ok $t ~~ /a.*b/, '$a was bound before $b';
+ ok $t ~~ /a.*c/, '$a was bound before $c';
+ ok $t ~~ /b.*c/, '$b was bound before $c';
+}
+
done_testing;
# vim: ft=perl6

0 comments on commit 82c4cad

Please sign in to comment.