Login
Added two new Policies with similar gist:
[gknop/Perl-Critic.git] / t / Subroutines / ProhibitExit.run
CommitLineData
3f9ba540
JRT
1##############################################################################
2# $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/lib/Perl/Critic/TestUtils.pm $
3# $Date: 2009-01-18 15:32:26 -0800 (Sun, 18 Jan 2009) $
4# $Author: clonezone $
5# $Revision: 3007 $
6##############################################################################
7
8## name basic pass, outside of subroutine
9## failures 0
10## cut
11
12
13exit;
14exit if $condition;
15$codition || exit();
16
17#-----------------------------------------------------------------------------
18
19## name basic failure, inside subroutine
20## failures 3
21## cut
22
23sub foo {
24 exit;
25 exit if $condition;
26 $codition || exit();
27}
28
29#-----------------------------------------------------------------------------
30
31## name not really exit() calls
32## failures 0
33## cut
34
35sub Foo {
36 $object->exit();
37 $hash{exit};
38}
39
40#-----------------------------------------------------------------------------
41
42##############################################################################
43# Local Variables:
44# mode: cperl
45# cperl-indent-level: 4
46# fill-column: 78
47# indent-tabs-mode: nil
48# c-indentation-style: bsd
49# End:
50# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :