3 ##############################################################################
4 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/20_policy_prohibithardtabs.t $
5 # $Date: 2008-06-06 00:48:04 -0500 (Fri, 06 Jun 2008) $
8 ##############################################################################
13 use Test::More tests => 5;
15 # common P::C testing tools
16 use Perl::Critic::TestUtils qw(pcritique fcritique);
17 Perl::Critic::TestUtils::block_perlcriticrc();
19 # This specific policy is being tested without run.t because the .run file
20 # would have to contain invisible characters.
23 my $policy = 'CodeLayout::ProhibitHardTabs';
26 #-----------------------------------------------------------------------------
29 #This will be interpolated!
41 is( pcritique($policy, \$code), 0, $policy );
43 #-----------------------------------------------------------------------------
46 #This will be interpolated!
47 print "\t \t foobar \t";
50 is( pcritique($policy, \$code), 1, $policy );
52 #-----------------------------------------------------------------------------
55 ##This will be interpolated!
65 %config = (allow_leading_tabs => 0);
66 is( pcritique($policy, \$code, \%config), 3, $policy );
68 #-----------------------------------------------------------------------------
71 ##This will be interpolated!
81 %config = (allow_leading_tabs => 0);
82 is( pcritique($policy, \$code, \%config), 3, $policy );
84 #-----------------------------------------------------------------------------
87 #This will be interpolated!
95 %config = (allow_leading_tabs => 0);
96 is( pcritique($policy, \$code, \%config), 0, 'Tabs in __DATA__' );
98 #-----------------------------------------------------------------------------
102 # cperl-indent-level: 4
104 # indent-tabs-mode: nil
105 # c-indentation-style: bsd
107 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :