Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test colonpair shortcuts involving twigils

git-svn-id: http://svn.pugscode.org/pugs@31212 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit ea467ee8841e8bd4377f31899a5090cc45af3885 1 parent 604c641
mmcleric authored
Showing with 22 additions and 3 deletions.
  1. +22 −0 S06-signature/named-parameters.t
  2. +0 −3  TODO
View
22 S06-signature/named-parameters.t
@@ -30,6 +30,28 @@ plan *;
eval_dies_ok 'my $y; c(:$y)', 'colonpair with wrong variable name dies';
}
+#?rakudo skip 'colonpair shortcuts with twigils (RT#73908)'
+{
+ sub add5(:$g) {
+ return $g + 5;
+ }
+ class A {
+ has $!g = 3;
+ method colonpair_private { add5(:$!g) }
+ };
+ class B {
+ has $.g = 7;
+ method colonpair_public { add5(:$.g) }
+ };
+ sub colonpair_positional {
+ add5(:$^g);
+ }
+
+ is A.new.colonpair_private, 8, 'colonpair with a privare variable';
+ is B.new.colonpair_public, 12, 'colonpair with a public variable';
+ is colonpair_positional(:g<10>), 15, 'colonpair with a positional variable';
+}
+
# L<S06/Named parameters>
sub simple_pos_param($x) { $x }
View
3  TODO
@@ -75,9 +75,6 @@ S05
* tests for the "special named assertions"
* more of everything.
-S06
-* test colonpair shortcuts involving twigils: :$!a, :$.a, :$^a
-
S09
* more tests for multidimensional arrays (also .shape, see S29)
* tests for user-defined array indexing
Please sign in to comment.
Something went wrong with that request. Please try again.