Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test statement-modifying "when"
  • Loading branch information
moritz committed Oct 1, 2011
1 parent ac23be8 commit 27a2b93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion S04-statements/given.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 48;
plan 49;

=begin pod
Expand Down Expand Up @@ -296,5 +296,13 @@ Tests the given block, as defined in L<S04/"Switch statements">
is $x, 42, 'given tests 1-arg subs for truth';
}

# statement-modifying 'when'
{
my $tracker = 1;
given 1 {
$tracker++ when 1;
}
is $tracker, 2, 'statement-modifying when';
}

# vim: ft=perl6

0 comments on commit 27a2b93

Please sign in to comment.