Permalink
Browse files

RT #69312, repeated &routine.wrap in a loop

  • Loading branch information...
1 parent 450fb6e commit 2f7692d1e332602a46f9b6922bdbc28f61c15a14 @moritz moritz committed Feb 1, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 S06-advanced/wrap.t
View
@@ -11,7 +11,7 @@ use Test;
# mutating wraps -- those should be "deep", as in not touching coderefs
# but actually mutating how the coderef works.
-plan 66;
+plan 67;
my @log;
@@ -200,6 +200,22 @@ dies_ok { {nextsame}() }, '{nextsame}() dies properly';
is foo(), 1, 'could unwrap by calling .restore on the handle';
}
+# RT #69312
+{
+ my @t = gather {
+ sub triangle { take '=' x 3; }
+ for reverse ^3 -> $n {
+ &triangle.wrap({
+ take '=' x $n;
+ callsame;
+ take '=' x $n;
+ });
+ }
+ triangle();
+ }
+ is @t.join("\n"), "\n=\n==\n===\n==\n=\n", 'multiple wrappings in a loop';
+}
+
done;
# vim: ft=perl6

0 comments on commit 2f7692d

Please sign in to comment.