From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

#!perl
##############################################################################
# $Date: 2009-07-21 08:50:56 -0700 (Tue, 21 Jul 2009) $
# $Author: clonezone $
# $Revision: 3404 $
##############################################################################
use 5.006001;
use strict;
# common P::C testing tools
use Perl::Critic::TestUtils qw(pcritique);
use Test::More tests => 1;
#-----------------------------------------------------------------------------
our $VERSION = '1.101_001';
#-----------------------------------------------------------------------------
Perl::Critic::TestUtils::block_perlcriticrc();
# This is in addition to the regular .run file.
my $policy = 'Modules::ProhibitEvilModules';
my $code = <<'END_PERL';
use Evil::Module qw(bad stuff);
use Super::Evil::Module;
END_PERL
my $result = eval { pcritique($policy, \$code); 1; };
ok(
! $result,
"$policy does not run if there are no evil modules configured.",
);
#-----------------------------------------------------------------------------
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 78
# indent-tabs-mode: nil
# c-indentation-style: bsd
# End:
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :