Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

documented some tests and added some tests for RT #53814

git-svn-id: http://svn.pugscode.org/pugs@26543 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 198d35391484ffa68c7b7f2cbb0c8b5269c83944 1 parent 8fd6ff7
ron authored
View
2  S06-multi/positional-vs-named.t
@@ -7,6 +7,8 @@ plan 26;
#L<S06/"Longname parameters">
#L<S12/"Multisubs and Multimethods">
+# the single parameter cases named and positional below - part of RT 53814
+
multi earth (:$me) {"me $me"};
multi earth (:$him) {"him $him"};
multi earth (:$me, :$him) {"me $me him $him"};
View
2  S06-signature/named-parameters.t
@@ -48,6 +48,8 @@ is(simple_pos_params( x => 4 ), 4, "simple named param");
sub foo (:$x = 3) { $x }
is(foo(), 3, "not specifying named params that aren't mandatory works");
+
+# part of RT 53814
#?rakudo todo 'using named as positional should fail'
#?pugs todo 'bug'
dies_ok({foo(4)}, "using a named as a positional fails");
View
10 S06-signature/optional.t
@@ -3,7 +3,7 @@ use Test;
# L<S06/Optional parameters/>
-plan 11;
+plan 13;
sub opt1($p?) { defined($p) ?? $p !! 'undef'; }
@@ -39,4 +39,12 @@ is opt_typed() , 'undef', 'can leave out optional typed param';
# before those bound to optional positional">
eval_dies_ok 'sub wrong ($a?, $b)', 'options params before required ones are forbidden';
+sub foo_53814($w, $x?, :$y = 2){ $w~"|"~$x~"|"~$y };
+#?rakudo todo 'RT #53814'
+{
+isnt foo_53814(1,undef,'something_extra',:y(3)), '1||something_extra',
+ 'should not pass positional param to named';
+dies_ok {foo_53814(1,undef,'something_extra',:y(3))},
+ 'according to ticket - answer should be no matching signature';
+}
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.