Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t/spec] tests for mysub(:$named_arg)

git-svn-id: http://svn.pugscode.org/pugs@24975 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit ebb8b24875c56816e06a865bcc6fe52dfad977e6 1 parent 50c19b6
moritz authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 S06-signature/named-parameters.t
View
6 S06-signature/named-parameters.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 67;
+plan 69;
# L<S06/Required parameters/"Passing a named argument that cannot be bound to
# a normal subroutine is also a fatal error.">
@@ -29,6 +29,10 @@ plan 67;
return $w;
}
is c(w => 3), 3, 'Named argument passes an integer, not a Pair';
+ my $x = 5;
+ #?rakudo 2 skip 'colonpair calling'
+ is c(:$x), 3, 'can use :$x colonpair syntax to call named arg';
+ eval_dies_ok 'my $y; c(:$y)', 'colonpair with wrong variable name dies';
}
# L<S06/Named parameters>
Please sign in to comment.
Something went wrong with that request. Please try again.