Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[t/spec] binding happens in parameter order

git-svn-id: http://svn.pugscode.org/pugs@28979 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 82c4cad0572e42f63bb012ab928a5fda4c0ecc78 1 parent 929d8e4
moritz authored

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. +13 0 S06-signature/named-parameters.t
13 S06-signature/named-parameters.t
@@ -249,6 +249,19 @@ eval_dies_ok 'sub svn28865( :$a, :@a ) {}',
249 249 'parameter rename appears in .signature.perl' );
250 250 }
251 251
  252 +# L<S06/Named parameters/Bindings happen in declaration order>
  253 +{
  254 + my $t = '';
  255 + sub order_test($a where { $t ~= 'a' },
  256 + $b where { $t ~= 'b' },
  257 + $c where { $t ~= 'c' }) { 8 };
  258 + is order_test(c => 5, a => 3, b => 2), 8,
  259 + 'can fill positional by name';
  260 + ok $t ~~ /a.*b/, '$a was bound before $b';
  261 + ok $t ~~ /a.*c/, '$a was bound before $c';
  262 + ok $t ~~ /b.*c/, '$b was bound before $c';
  263 +}
  264 +
252 265 done_testing;
253 266
254 267 # vim: ft=perl6

0 comments on commit 82c4cad

Please sign in to comment.
Something went wrong with that request. Please try again.