Login
Allow specification of violation descriptions in ProhibitEvilModules.
[gknop/Perl-Critic.git] / t / Modules / ProhibitEvilModules.run
CommitLineData
2e2680d2
ES
1## name No modules configured
2## failures 0
3## cut
4
5use Evil::Module qw(bad stuff);
6use Super::Evil::Module;
7
6036a254 8#-----------------------------------------------------------------------------
2e2680d2 9
23c642e5
JRT
10## name 2 evil modules
11## parms {modules => 'Evil::Module Super::Evil::Module'}
12## failures 2
13## cut
485f86d9 14
485f86d9
JRT
15use Evil::Module qw(bad stuff);
16use Super::Evil::Module;
485f86d9 17
6036a254 18#-----------------------------------------------------------------------------
2e2680d2 19
23c642e5 20## name No evil modules
a6539177 21## parms {modules => ' Evil::Module Super::Evil::Module'}
23c642e5
JRT
22## failures 0
23## cut
485f86d9 24
485f86d9 25use Good::Module;
485f86d9 26
6036a254 27#-----------------------------------------------------------------------------
2e2680d2 28
23c642e5 29## name 2 evil modules, with pattern matching
a6539177 30## parms { modules => '/Evil::/ /Demonic/ ' }
23c642e5
JRT
31## failures 2
32## cut
485f86d9 33
26babf22
JRT
34use Evil::Module qw(bad stuff);
35use Demonic::Module
26babf22 36
6036a254 37#-----------------------------------------------------------------------------
2e2680d2 38
23c642e5 39## name More evil modules, with mixed config
a6539177 40## parms { modules => ' /Evil::/ Demonic::Module /Acme/' }
23c642e5
JRT
41## failures 4
42## cut
26babf22 43
26babf22
JRT
44use Evil::Module qw(bad stuff);
45use Super::Evil::Module;
46use Demonic::Module;
47use Acme::Foo;
26babf22 48
6036a254 49#-----------------------------------------------------------------------------
2e2680d2 50
23c642e5 51## name More evil modules, with more pattern matching
a6539177 52## parms { modules => '/Evil::|Demonic::Module|Acme/ ' }
23c642e5
JRT
53## failures 4
54## cut
26babf22 55
7cc385e4
CD
56use Evil::Module qw(bad stuff);
57use Super::Evil::Module;
58use Demonic::Module;
59use Acme::Foo;
7cc385e4 60
6036a254 61#-----------------------------------------------------------------------------
2e2680d2 62
23c642e5
JRT
63## name Pattern matching exceptions
64## parms { modules => '/(/' }
65## failures 0
6ed4d974 66## error /invalid regular expression/
23c642e5 67## cut
7cc385e4 68
23c642e5 69print 'Hello World';
d189cab9 70
a6539177
ES
71#-----------------------------------------------------------------------------
72
73## name Providing the description for modules, no regular expressions.
74## parms { modules => q' Fatal{Found use of Fatal. Use autodie instead} Getopt::Std {Found use of Getopt::Std. Use Getopt::Long instead} ' }
75## failures 2
76## cut
77
78use Fatal qw< open close >;
79use Getopt::Std;
80
81#-----------------------------------------------------------------------------
82
83## name Providing the description for modules, regular expressions.
84## parms { modules => q' /Fatal/{Found use of Fatal. Use autodie instead} /Getopt::Std/ {Found use of Getopt::Std. Use Getopt::Long instead} ' }
85## failures 2
86## cut
87
88use Fatal qw< open close >;
89use Getopt::Std;
90
91#-----------------------------------------------------------------------------
92
93# $URL$
94# $Date$
95# $Author$
96# $Revision$
97
23c642e5 98##############################################################################
737d3b65
CD
99# Local Variables:
100# mode: cperl
101# cperl-indent-level: 4
102# fill-column: 78
103# indent-tabs-mode: nil
104# c-indentation-style: bsd
105# End:
96fed375 106# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :