Build all packages removed dependencies of libtest-exception-perl libtest-warn-perl...
[dh-make-perl] / dev / i386 / libperl-critic-perl / libperl-critic-perl-1.088 / t / CodeLayout / ProhibitParensWithBuiltins.run
1 ## name Basic failure
2 ## failures 6
3 ## cut
4
5 open ($foo, $bar);
6 open($foo, $bar);
7 uc();
8 lc();
9
10 # These ones deliberately omit the semi-colon
11 sub {uc()}
12 sub {reverse()}
13
14 #-----------------------------------------------------------------------------
15
16 ## name Basic passing
17 ## failures 0
18 ## cut
19
20 open $foo, $bar;
21 uc $foo;
22 lc $foo;
23 my $foo;
24 my ($foo, $bar);
25 our ($foo, $bar);
26 local ($foo $bar);
27 return ($foo, $bar);
28 return ();
29 my_subroutine($foo $bar);
30 {print}; # for Devel::Cover
31
32 #-----------------------------------------------------------------------------
33
34 ## name Method invocation
35 ## failures 0
36 ## cut
37
38 my $obj = SomeClass->new();
39 $obj->open();
40 $obj->close();
41 $obj->prototype();
42 $obj->delete();
43
44 is( pcritique($policy, \$code), 0, $policy);
45
46 #-----------------------------------------------------------------------------
47
48 ## name Parentheses with unary operators
49 ## failures 0
50 ## cut
51
52 $foo = int( 0.5 ) + 1.5;
53 $foo = int( 0.5 ) - 1.5;
54 $foo = int( 0.5 ) * 1.5;
55 $foo = int( 0.5 ) / 1.5;
56 $foo = int( 0.5 ) ** 1.5;
57
58 $foo = oct( $foo ) + 1;
59 $foo = ord( $foo ) - 1;
60 $foo = sin( $foo ) * 2;
61 $foo = uc( $foo ) . $bar;
62 $foo = lc( $foo ) . $bar;
63
64 #-----------------------------------------------------------------------------
65
66 ## name RT #21713
67 ## failures 0
68 ## cut
69
70 print substr($foo, 2, 3), "\n";
71 if ( unpack('V', $foo) == 2 ) { }
72
73 #-----------------------------------------------------------------------------
74
75 ## name Parentheses with greedy functions
76 ## failures 0
77 ## cut
78
79 substr join( $delim, @list), $offset, $length;
80 print reverse( $foo, $bar, $baz), $nuts;
81 sort map( {some_func($_)} @list1 ), @list2;
82
83 #-----------------------------------------------------------------------------
84
85 ## name Test cases from RT
86 ## failures 0
87 ## cut
88
89 chomp( my $foo = <STDIN> );
90 defined( my $child = shift @free_children )
91 return ( $start_time + $elapsed_hours ) % $hours_in_day;
92
93 #-----------------------------------------------------------------------------
94
95 ## name High-precedence operator after parentheses
96 ## failures 0
97 ## cut
98
99 grep( { do_something($_) }, @list ) + 3;
100 join( $delim, @list ) . "\n";
101 pack( $template, $foo, $bar ) . $suffix;
102 chown( $file1, $file2 ) || die q{Couldn't chown};
103
104 #-----------------------------------------------------------------------------
105
106 ## name Low-precedence operator after parentheses
107 ## failures 2
108 ## cut
109
110 grep( { do_something($_) }, $foo, $bar) and do_something();
111 chown( $file1, $file2 ) or die q{Couldn't chown};
112
113 #-----------------------------------------------------------------------------
114
115 ## name Handling sort having subroutine name as an argument
116 ## failures 0
117 ## cut
118
119 sort(foo(@x));
120 [ sort ( modules_used_in_string( $code ) ) ]
121
122 #-----------------------------------------------------------------------------
123
124 ##############################################################################
125 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/CodeLayout/ProhibitParensWithBuiltins.run $
126 #     $Date: 2008-06-17 01:11:23 -0500 (Tue, 17 Jun 2008) $
127 #   $Author: chrisdolan $
128 # $Revision: 2446 $
129 ##############################################################################
130
131 # Local Variables:
132 #   mode: cperl
133 #   cperl-indent-level: 4
134 #   fill-column: 78
135 #   indent-tabs-mode: nil
136 #   c-indentation-style: bsd
137 # End:
138 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :