Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[spec] more tests for named parameters, and fudged them for rakudo

git-svn-id: http://svn.pugscode.org/pugs@21250 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit a5cd2dd4e322f58fd6a966d503ff450b2df0a2b0 1 parent aa2e9ad
moritz authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 S06-signature/named-parameters.t
View
17 S06-signature/named-parameters.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 2;
+plan 4;
# L<S06/Required parameters/"Passing a named argument that cannot be bound to
# a normal subroutine is also a fatal error.">
@@ -15,3 +15,18 @@ plan 2;
#?rakudo todo 'Named args, RT #54812'
eval_dies_ok('a(g=>7)', 'Dies on passing superflous arguments');
}
+
+{
+ # see http://rt.perl.org/rt3/Ticket/Display.html?id=54808
+ sub b($x) {
+ return $x;
+ }
+
+ #?rakudo skip 'Passing positional parameters as named ones'
+ is b(:x(3)), 3, 'Can pass positional parameters as named ones';
+
+ sub c(:$w=4){
+ return $w;
+ }
+ is c(w => 3), 3, 'Named argument passes an integer, not a Pair';
+}
Please sign in to comment.
Something went wrong with that request. Please try again.