Permalink
Browse files

[t/spec] more tests for duplicate sub params

git-svn-id: http://svn.pugscode.org/pugs@28867 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent b02b1ec commit 8ebc55e02ef21e47560d5798f0faa3aba262fc58 kyle committed Oct 21, 2009
Showing with 13 additions and 1 deletion.
  1. +13 −1 S06-signature/named-parameters.t
View
14 S06-signature/named-parameters.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 78;
+plan *;
# L<S06/Required parameters/"Passing a named argument that cannot be bound to
# a normal subroutine is also a fatal error.">
@@ -212,9 +212,19 @@ ok(%fellowship<dwarf> ~~ undef, "dwarf arg was not given");
dies_ok { renames(:x(23)) }, 'old name is not available';
}
+# L<06/Parameters and arguments/"All parameters must either have a unique name">
+
#?rakudo todo 'RT #68086'
eval_dies_ok 'sub rt68086( $a, $a ) { }', 'two sub params with the same name';
+#?rakudo 3 todo 'sub params with the same name'
+eval_dies_ok 'sub svn28865( $a, :a($b) ) {}',
+ 'sub params with the same name via renaming';
+eval_dies_ok 'sub svn28865( $a, :a(@b) ) {}',
+ 'sub params with same name via renaming and different types';
+eval_dies_ok 'sub svn28865( :$a, :@a ) {}',
+ 'sub params with the same name and different types';
+
# RT #68524
{
sub rt68524( :$a! ) {}
@@ -229,4 +239,6 @@ eval_dies_ok 'sub rt68086( $a, $a ) { }', 'two sub params with the same name';
'parameter rename appears in .signature.perl' );
}
+done_testing;
+
# vim: ft=perl6

0 comments on commit 8ebc55e

Please sign in to comment.