Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

basic test for declarations with indirect names

  • Loading branch information...
commit eb6e664976236d43e8955a9e715007669af0b964 1 parent 81d488a
@moritz moritz authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 S02-names/indirect.t
View
23 S02-names/indirect.t
@@ -0,0 +1,23 @@
+use v6;
+use Test;
+
+plan 4;
+
+{
+ my constant name = 'TestName';
+ class ::(name) {
+ method f() { 42 }
+ }
+ is TestName.f, 42,
+ 'can declare and use a class with indirect (but constant) name';
+ is ::(name).^name, 'TestName',
+ 'and it reports the right name';
+}
+
+#?rakudo skip 'indirect subname NYI'
+{
+ my constant name = 'a';
+ sub ::(name) ($x) { $x + 38 }
+ is a(4), 42, 'indirect sub name works';
+ is &a.name, 'a', 'and the sub knows its name';
+}
Please sign in to comment.
Something went wrong with that request. Please try again.