Login
RT #67760: RequireLexicalLoopIterators vs perl version
[gknop/Perl-Critic.git] / t / Variables / RequireLexicalLoopIterators.run
CommitLineData
1f8bff8c
AL
1## name Basic failure
2## failures 2
3## cut
78586a4f
AL
4
5for $foo ( @list ) {}
6foreach $foo ( @list ) {}
7
6036a254 8#-----------------------------------------------------------------------------
78586a4f 9
1f8bff8c
AL
10## name Basic passing
11## failures 0
12## cut
78586a4f
AL
13
14for my $foo ( @list ) {}
15foreach my $foo ( @list ) {}
16
6036a254 17#-----------------------------------------------------------------------------
78586a4f 18
df1c4874 19## name Passing lexicals on loops with labels.
ad277699
ES
20## failures 0
21## cut
22
23LABEL: for my $foo ( @list ) {}
24ANOTHER_LABEL: foreach my $foo ( @list ) {}
25
df1c4874
ES
26BING: for ( @list ) {}
27BANG: foreach ( @list ) {}
28
29#-----------------------------------------------------------------------------
30
31## name Failing lexicals on loops with labels.
32## failures 2
33## cut
34
35LABEL: for $foo ( @list ) {}
36ANOTHER_LABEL: foreach $foo ( @list ) {}
37
ad277699
ES
38#-----------------------------------------------------------------------------
39
1f8bff8c
AL
40## name Implicit $_ passes
41## failures 0
42## cut
78586a4f
AL
43
44for ( @list ) {}
45foreach ( @list ) {}
46
6036a254 47#-----------------------------------------------------------------------------
78586a4f 48
1f8bff8c
AL
49## name Other compounds
50## failures 0
51## cut
78586a4f
AL
52
53for ( $i=0; $i<10; $i++ ) {}
54while ( $condition ) {}
55until ( $condition ) {}
054473f6 56
6036a254 57#-----------------------------------------------------------------------------
054473f6 58
5920ee7c
TW
59## name Ignore really, really old Perls. RT #67760
60## failures 0
61## cut
62
b18262f2 63require 5.003;
5920ee7c
TW
64
65foreach $foo ( @list ) {
66 bar( $foo );
67}
68
69
70#-----------------------------------------------------------------------------
71
6036a254 72##############################################################################
054473f6
ES
73# $URL$
74# $Date$
75# $Author$
76# $Revision$
6036a254 77##############################################################################
054473f6
ES
78
79# Local Variables:
80# mode: cperl
81# cperl-indent-level: 4
82# fill-column: 78
83# indent-tabs-mode: nil
84# c-indentation-style: bsd
85# End:
96fed375 86# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :