Login
New policy InputOutput::RequireBriefOpen
[gknop/Perl-Critic.git] / t / BuiltinFunctions / ProhibitVoidMap.run
CommitLineData
6977a06e
ES
1## name Basic passing
2## failures 0
3## cut
4
5$baz, map "$foo", @list;
6print map("$foo", @list);
7print ( map "$foo", @list );
8@list = ( map $foo, @list );
9$aref = [ map $foo, @list ];
10$href = { map $foo, @list };
11
12if( map { foo($_) } @list ) {}
13for( map { foo($_) } @list ) {}
14
15#-----------------------------------------------------------------------------
16
17## name Basic failure
18## failures 7
19## cut
20
21map "$foo", @list;
22map("$foo", @list);
23map { foo($_) } @list;
24map({ foo($_) } @list);
25
26if( $condition ){ map { foo($_) } @list }
27while( $condition ){ map { foo($_) } @list }
28for( @list ){ map { foo($_) } @list }
29
30#-----------------------------------------------------------------------------
31
32## name Chained void map
33## failures 1
34## cut
35
36map { foo($_) }
37 map { bar($_) }
38 map { baz($_) } @list;
39
40#-----------------------------------------------------------------------------
41
42##############################################################################
43# $URL$
44# $Date$
45# $Author$
46# $Revision$
47##############################################################################
48
49# Local Variables:
50# mode: cperl
51# cperl-indent-level: 4
52# fill-column: 78
53# indent-tabs-mode: nil
54# c-indentation-style: bsd
55# End:
56# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab :