Permalink
Browse files

[spec] simple tests for named parameters

git-svn-id: http://svn.pugscode.org/pugs@21249 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
moritz
moritz committed Jul 7, 2008
1 parent 7369111 commit aa2e9ad86b8297832e5db4f9ceeedc8138b1150c
Showing with 17 additions and 0 deletions.
  1. +17 −0 S06-signature/named-parameters.t
@@ -0,0 +1,17 @@
+use v6;
+use Test;
+
+plan 2;
+
+# L<S06/Required parameters/"Passing a named argument that cannot be bound to
+# a normal subroutine is also a fatal error.">
+
+{
+ # see http://rt.perl.org/rt3/Ticket/Display.html?id=54812
+ sub a($x = 4) {
+ return $x;
+ }
+ is a(3), 3, 'Can pass positional arguments';
+ #?rakudo todo 'Named args, RT #54812'
+ eval_dies_ok('a(g=>7)', 'Dies on passing superflous arguments');
+}

0 comments on commit aa2e9ad

Please sign in to comment.