Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / t / BuiltinFunctions / ProhibitVoidGrep.run
1 ## name Basic passing
2 ## failures 0
3 ## cut
4
5 print grep("$foo", @list);
6 print ( grep "$foo", @list );
7 @list = ( grep "$foo", @list );
8 $aref = [ grep "$foo", @list ];
9 $href = { grep "$foo", @list };
10
11 if( grep { foo($_) } @list ) {}
12 for( grep { foo($_) } @list ) {}
13
14 #-----------------------------------------------------------------------------
15
16 ## name Basic failure
17 ## failures 7
18 ## cut
19
20 grep "$foo", @list;
21 grep("$foo", @list);
22 grep { foo($_) } @list;
23 grep({ foo($_) } @list);
24
25 if( $condition ){ grep { foo($_) } @list }
26 while( $condition ){ grep { foo($_) } @list }
27 for( @list ){ grep { foo($_) } @list }
28
29 #-----------------------------------------------------------------------------
30
31 ## name Comma operator
32 ## failures 1
33 ## TODO not handled properly
34 ## cut
35
36 $baz, grep "$foo", @list;
37
38 #-----------------------------------------------------------------------------
39
40 ## name Chained void grep
41 ## failures 1
42 ## cut
43
44 grep { spam($_) }
45   grep { foo($_) }
46     grep { bar($_) }
47       grep { baz($_) } @list;
48
49 #-----------------------------------------------------------------------------
50
51 ##############################################################################
52 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/BuiltinFunctions/ProhibitVoidGrep.run $
53 #     $Date: 2008-03-16 17:40:45 -0500 (Sun, 16 Mar 2008) $
54 #   $Author: clonezone $
55 # $Revision: 2187 $
56 ##############################################################################
57
58 # Local Variables:
59 #   mode: cperl
60 #   cperl-indent-level: 4
61 #   fill-column: 78
62 #   indent-tabs-mode: nil
63 #   c-indentation-style: bsd
64 # End:
65 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :