Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test for role/mixin/grammar/LTM interaction.

  • Loading branch information...
commit 91543c1d2fc386db2d0daaa8a59b8811f81f6dbd 1 parent 346be83
Jonathan Worthington jnthn authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 t/nqp/66-pararole.t
14 t/nqp/66-pararole.t
View
@@ -1,4 +1,4 @@
-plan(4);
+plan(6);
role ParaTest[$a] {
method m() { $a }
@@ -26,3 +26,15 @@ $b.HOW.mixin($b, ParaNameTest.HOW.curry(ParaNameTest, "drink", "beer"));
$b.HOW.mixin($b, ParaNameTest.HOW.curry(ParaNameTest, "meat", "beef"));
ok($b.drink eq "beer", "parametric method name handling works (1)");
ok($b.meat eq "beef", "parametric method name handling works (2)");
+
+grammar LolGrammar {
+ token TOP { <foo> }
+ proto token foo {*}
+ token foo:sym<a> { <sym> }
+}
+role AnotherFoo[$x] {
+ token foo:sym<more> { $x }
+}
+ok(LolGrammar.parse('abc') eq 'a', "parametric mixin/grammar/LTM interaction (sanity)");
+my $derived := LolGrammar.HOW.mixin(LolGrammar, AnotherFoo.HOW.curry(AnotherFoo, 'ab'));
+ok($derived.parse('abc') eq 'ab', "parametric mixin/grammar/LTM interaction");
Please sign in to comment.
Something went wrong with that request. Please try again.