Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / t / ControlStructures / ProhibitUnreachableCode.run
1 ## name Basic passing
2 ## failures 0
3 ## cut
4
5 sub a {
6   return 123 if $a == 1;
7   do_something();
8 }
9
10 sub b {
11   croak 'error' unless $b;
12   do_something();
13 }
14
15 sub c {
16   confess 'error' if $c != $d;
17   do_something();
18 }
19
20 for (1..2) {
21   next if $_ == 1;
22   do_something();
23 }
24
25 for (1..2) {
26   last if $_ == 2;
27   do_something();
28 }
29
30 for (1..2) {
31   redo if do_this($_);
32   do_something();
33 }
34
35 {
36     exit;
37     FOO:
38     do_something();
39 }
40
41 {
42     die;
43     BAR:
44     do_something();
45 }
46
47 {
48     exit;
49     sub d {}
50     BAZ:
51     print 123;
52 }
53
54 {
55     die;
56     JAPH:
57     sub e {}
58     print 456;
59 }
60
61 {
62     exit;
63     BEGIN {
64         print 123;
65     }
66 }
67
68 {
69    $foo || die;
70    print 123;
71 }
72
73 #-----------------------------------------------------------------------------
74
75 ## name Basic failure
76 ## failures 12
77 ## cut
78
79 {
80     exit;
81     require Foo;
82 }
83
84 sub a {
85   return 123;
86   do_something();
87 }
88
89 sub b {
90   croak 'error';
91   do_something();
92 }
93
94 sub c {
95   confess 'error';
96   do_something();
97 }
98
99 for (1..2) {
100   next;
101   do_something();
102 }
103
104 for (1..2) {
105   last;
106   do_something();
107 }
108
109 for (1..2) {
110   redo;
111   do_something();
112 }
113
114 {
115     exit;
116     do_something();
117 }
118
119
120 {
121     die;
122     do_something();
123 }
124
125
126 {
127     exit;
128     sub d {}
129     print 123;
130 }
131
132 {
133    $foo, die;
134    print 123;
135 }
136
137 die;
138 print 456;
139 FOO: print $baz;
140
141 #-----------------------------------------------------------------------------
142
143 ## name Compile-time code
144 ## failures 0
145 ## cut
146
147 exit;
148
149 no warnings;
150 use Memoize;
151 our %memoization;
152
153 #-----------------------------------------------------------------------------
154
155 ## name __DATA__ section
156 ## failures 0
157 ## cut
158
159 exit;
160
161 __DATA__
162 ...
163
164 #-----------------------------------------------------------------------------
165
166 ## name __END__ section
167 ## failures 0
168 ## cut
169
170 exit;
171
172 __END__
173 ...
174
175 #-----------------------------------------------------------------------------
176
177 ## name RT #36080
178 ## failures 0
179 ## cut
180
181 my $home = $ENV{HOME} // die "HOME not set";
182 say 'hello';
183
184 #-----------------------------------------------------------------------------
185
186 ##############################################################################
187 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/ControlStructures/ProhibitUnreachableCode.run $
188 #     $Date: 2008-05-21 14:50:31 -0500 (Wed, 21 May 2008) $
189 #   $Author: clonezone $
190 # $Revision: 2397 $
191 ##############################################################################
192
193 # Local Variables:
194 #   mode: cperl
195 #   cperl-indent-level: 4
196 #   fill-column: 78
197 #   indent-tabs-mode: nil
198 #   c-indentation-style: bsd
199 # End:
200 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :