Build all packages removed dependencies of libtest-exception-perl libtest-warn-perl...
[dh-make-perl] / dev / i386 / libperl-critic-perl / libperl-critic-perl-1.088 / t / ControlStructures / ProhibitDeepNests.run
1 ## name 6 for loops
2 ## failures 1
3 ## cut
4
5 for $element1 ( @list1 ) {
6     foreach $element2 ( @list2 ) {
7         for $element3 ( @list3 ) {
8             foreach $element4 ( @list4 ) {
9                for $element5 ( @list5 ) {
10                   for $element6 ( @list6 ) {
11                   }
12                }
13             }
14         }
15     }
16 }
17
18 #-----------------------------------------------------------------------------
19
20 ## name 6 if blocks
21 ## failures 1
22 ## cut
23
24 if ($condition1) {
25   if ($condition2) {
26     if ($condition3) {
27       if ($condition4) {
28         if ($condition5) {
29           if ($condition6) {
30           }
31         }
32       }
33     }
34   }
35 }
36
37 #-----------------------------------------------------------------------------
38
39 ## name 6 if blocks, not nested
40 ## failures 0
41 ## cut
42
43 if ($condition1) {
44   if ($condition2) {}
45   if ($condition3) {}
46   if ($condition4) {}
47   if ($condition5) {}
48   if ($condition6) {}
49 }
50
51 #-----------------------------------------------------------------------------
52
53 ## name 6 for loops, not nested
54 ## failures 0
55 ## cut
56
57 for     $element1 ( @list1 ) {
58   foreach $element2 ( @list2 ) {}
59   for     $element3 ( @list3 ) {}
60   foreach $element4 ( @list4 ) {}
61   for     $element5 ( @list5 ) {}
62   foreach $element6 ( @list6 ) {}
63 }
64
65 #-----------------------------------------------------------------------------
66
67 ## name 6 mixed nests
68 ## failures 1
69 ## cut
70
71 if ($condition) {
72   foreach ( @list ) {
73     until ($condition) {
74       for (my $i=0; $<10; $i++) {
75         if ($condition) {
76           while ($condition) {
77           }
78         }
79       }
80     }
81   }
82 }
83
84 is( pcritique($policy, \$code), 1, '');
85
86 #-----------------------------------------------------------------------------
87
88 ## name Configurable
89 ## failures 0
90 ## parms {max_nests => 6}
91 ## cut
92
93 if ($condition) {
94   foreach ( @list ) {
95     until ($condition) {
96       for (my $i=0; $<10; $i++) {
97         if ($condition) {
98           while ($condition) {
99           }
100         }
101       }
102     }
103   }
104 }
105
106 #-----------------------------------------------------------------------------
107
108 ## name With postfixes
109 ## failures 0
110 ## cut
111
112 if ($condition) {
113     s/foo/bar/ for @list;
114     until ($condition) {
115       for (my $i=0; $<10; $i++) {
116           die if $condition;
117         while ($condition) {
118         }
119       }
120    }
121 }
122
123 #-----------------------------------------------------------------------------
124
125 ##############################################################################
126 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/ControlStructures/ProhibitDeepNests.run $
127 #     $Date: 2008-03-16 17:40:45 -0500 (Sun, 16 Mar 2008) $
128 #   $Author: clonezone $
129 # $Revision: 2187 $
130 ##############################################################################
131
132 # Local Variables:
133 #   mode: cperl
134 #   cperl-indent-level: 4
135 #   fill-column: 78
136 #   indent-tabs-mode: nil
137 #   c-indentation-style: bsd
138 # End:
139 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :