Skip to content

Commit

Permalink
Here is a test for last in an inferior runloop. May not be general en…
Browse files Browse the repository at this point in the history
…ough.
  • Loading branch information
sorear committed Aug 6, 2011
1 parent 53d2c03 commit 9b9d276
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions S04-exceptions/control_across_runloop.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use v6;

use Test;

# L<S04/Control Exceptions>

# Test primarily aimed at Niecza

plan 1;

{
sub foo($x = last) { $x }

my $i = 0;
for 1,2,3 { $i++; foo(); }

is $i, 1, 'control operator last can be used in an inferior context';
}

# vim: ft=perl6

0 comments on commit 9b9d276

Please sign in to comment.