Permalink
Browse files

Test for wrapping in a trait_mod.

  • Loading branch information...
jnthn committed Sep 16, 2012
1 parent 38eaa62 commit 68efa9a0647f5d86fb8dbfe20e84bb9037540652
Showing with 9 additions and 1 deletion.
  1. +9 −1 S14-traits/routines.t
View
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 12;
+plan 13;
# L<S14/Traits/>
{
@@ -71,6 +71,14 @@ plan 12;
'declaration of a sub with an unknown trait mentions trait_mod:<is> in dispatch error';
}
+{
+ multi trait_mod:<is>(Routine $r, :$trait_that_wraps!) {
+ $r.wrap(-> |c { 2 * callsame; })
+ }
+ sub wrappee($a, $b) is trait_that_wraps { 42 };
+ is wrappee(1, 2), 84, 'wrapping a routine at compile time makes it soft';
+}
+
done();
# vim: ft=perl6

0 comments on commit 68efa9a

Please sign in to comment.