Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / t / ControlStructures / ProhibitMutatingListFunctions.run
1 ## name Assignment and op-assignment
2 ## failures 3
3 ## cut
4
5 @bar = map {$_ = 1} @foo;
6 @bar = map {$_ *= 2} @foo;
7 @bar = map {$_++} @foo;
8
9 #-----------------------------------------------------------------------------
10
11 ## name ++ and -- operators
12 ## failures 2
13 ## cut
14
15 @bar = map {++$_} @foo;
16 @bar = map {--$_} @foo;
17
18 #-----------------------------------------------------------------------------
19
20 ## name Explicit regexes
21 ## failures 3
22 ## cut
23
24 @bar = map {$_ =~ s/f/g/} @foo;
25 @bar = map {$_ =~ tr/f/g/} @foo;
26 @bar = map {$_ =~ y/f/g/} @foo;
27
28 #-----------------------------------------------------------------------------
29
30 ## name Simple implicit regexps
31 ## failures 3
32 ## cut
33
34 @bar = map {s/f/g/} @foo;
35 @bar = map {tr/f/g/} @foo;
36 @bar = map {y/f/g/} @foo;
37
38 #-----------------------------------------------------------------------------
39
40 ## name "Hidden" implicit regexps
41 ## failures 3
42 ## cut
43
44 @bar = map {my $c = s/f/g/g; $c} @foo;
45 @bar = map {my $c = tr/f/g/g; $c} @foo;
46 @bar = map {my $c = y/f/g/g; $c} @foo;
47
48 #-----------------------------------------------------------------------------
49
50 ## name Implicit chomp-ish builtins
51 ## failures 2
52 ## cut
53
54 @bar = map {chop} @foo;
55 @bar = map {chomp} @foo;
56 @bar = map {undef} @foo;
57
58 #-----------------------------------------------------------------------------
59
60 ## name Explicit chomp-ish builtins
61 ## failures 3
62 ## cut
63
64 @bar = map {chop $_} @foo;
65 @bar = map {chomp $_} @foo;
66 @bar = map {undef $_} @foo;
67
68 #-----------------------------------------------------------------------------
69
70 ## name substr
71 ## failures 1
72 ## cut
73
74 @bar = map {substr $_, 0, 1, 'f'} @foo;
75
76 #-----------------------------------------------------------------------------
77
78 ## name Non-mutators
79 ## failures 0
80 ## cut
81
82 @bar = map {$_} @foo;
83 @bar = map {$_ => 1} @foo;
84 @bar = map {m/4/} @foo;
85 @bar = map {my $s=$_; chomp $s; $s} @foo;
86
87 #-----------------------------------------------------------------------------
88
89 ## name Value given for list_funcs passing
90 ## failures 0
91 ## parms {list_funcs => ' foo bar '}
92 ## cut
93
94 @bar = map {$_=1} @foo;
95 @bar = foo {$_} @foo;
96 @bar = baz {$_=1} @foo;
97
98 #-----------------------------------------------------------------------------
99
100 ## name Value given for list_funcs failure
101 ## failures 1
102 ## parms {list_funcs => ' foo bar '}
103 ## cut
104
105 @bar = foo {$_=1} @foo;
106
107 #-----------------------------------------------------------------------------
108
109 ## name Value given for add_list_funcs
110 ## failures 2
111 ## parms {add_list_funcs => ' foo bar '}
112 ## cut
113
114 @bar = map {$_=1} @foo;
115 @bar = foo {$_=1} @foo;
116
117 #-----------------------------------------------------------------------------
118
119 ##############################################################################
120 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/ControlStructures/ProhibitMutatingListFunctions.run $
121 #     $Date: 2008-03-16 17:40:45 -0500 (Sun, 16 Mar 2008) $
122 #   $Author: clonezone $
123 # $Revision: 2187 $
124 ##############################################################################
125
126 # Local Variables:
127 #   mode: cperl
128 #   cperl-indent-level: 4
129 #   fill-column: 78
130 #   indent-tabs-mode: nil
131 #   c-indentation-style: bsd
132 # End:
133 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :