Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / t / 20_policy_prohibittrailingwhitespace.t
1 #!perl
2
3 ##############################################################################
4 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/20_policy_prohibittrailingwhitespace.t $
5 #     $Date: 2008-06-06 00:48:04 -0500 (Fri, 06 Jun 2008) $
6 #   $Author: clonezone $
7 # $Revision: 2416 $
8 ##############################################################################
9
10 use 5.006001;
11 use strict;
12 use warnings;
13 use Test::More tests => 2;
14
15 use Perl::Critic::Utils qw( :characters );
16
17 use Perl::Critic::TestUtils qw( pcritique );
18 Perl::Critic::TestUtils::block_perlcriticrc();
19
20 # This specific policy is being tested without 20_policies.t because the .run file
21 # would have to contain invisible characters.
22
23 my $code;
24 my $policy = 'CodeLayout::ProhibitTrailingWhitespace';
25 my %config;
26 my @violations;
27 my $violation_line_number;
28 my $violation_column_number;
29
30 #-----------------------------------------------------------------------------
31
32 $code = <<"END_PERL";
33 say${SPACE}"\tblurp\t";\t
34 say${SPACE}"${SPACE}blorp${SPACE}";${SPACE}
35 \f
36
37
38 chomp;\t${SPACE}${SPACE}
39 chomp;${SPACE}${SPACE}\t
40 END_PERL
41
42 is ( pcritique($policy, \$code), 5, $policy );
43
44 #-----------------------------------------------------------------------------
45
46 $code = <<"END_PERL";
47 sub${SPACE}do_frobnication${SPACE}\{
48 \tfor${SPACE}(${SPACE}is_frobnicating()${SPACE})${SPACE}\{
49 ${SPACE}${SPACE}${SPACE}${SPACE}frobnicate();
50 \l}
51 }
52
53 END_PERL
54
55 is( pcritique($policy, \$code), 0, $policy );
56
57 #-----------------------------------------------------------------------------
58
59 # Local Variables:
60 #   mode: cperl
61 #   cperl-indent-level: 4
62 #   fill-column: 78
63 #   indent-tabs-mode: nil
64 #   c-indentation-style: bsd
65 # End:
66 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :