Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / t / ValuesAndExpressions / ProhibitMixedBooleanOperators.run
1 ##############################################################################
2 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/ValuesAndExpressions/ProhibitMixedBooleanOperators.run $
3 #     $Date: 2008-03-16 17:40:45 -0500 (Sun, 16 Mar 2008) $
4 #   $Author: clonezone $
5 # $Revision: 2187 $
6 ##############################################################################
7
8
9 ## name High-precedence passing
10 ## failures 0
11 ## cut
12
13 next if ! $finished || $foo < $bar;
14 if( $foo && !$bar || $baz){ do_something() }
15 this() && !that() || the_other(); 
16
17 #-----------------------------------------------------------------------------
18
19 ## name Low-precedence passing
20 ## failures 0
21 ## cut
22
23 next if not $finished or $foo < $bar;
24 if( $foo and not $bar or $baz){ do_something() }
25 this() and not that() or the_other(); 
26
27 #-----------------------------------------------------------------------------
28
29 ## name Basic failure
30 ## failures 3
31 ## cut
32
33 next if not $finished || $foo < $bar;
34 if( $foo && not $bar or $baz){ do_something() }
35 this() and ! that() or the_other(); 
36
37 #-----------------------------------------------------------------------------
38
39 ## name High-precedence with low precedence self-equals
40 ## failures 0
41 ## cut
42
43 $sub ||= sub {
44    return 1 and 2;
45 };
46
47 #-----------------------------------------------------------------------------
48
49 ## name Mixed booleans in same statement, but different expressions
50 ## failures 0
51 ## cut
52
53 # See http://rt.cpan.org/Ticket/Display.html?id=27637
54 ok( ! 1, 'values are URLs' ) or diag 'never happens';
55
56 #-----------------------------------------------------------------------------
57
58 ## name Mixed booleans in code blocks
59 ## failures 0
60 ## cut
61
62 eval {
63     if (1 || 2) {
64         return not 3;
65     }
66 };
67
68 ##############################################################################
69 # Local Variables:
70 #   mode: cperl
71 #   cperl-indent-level: 4
72 #   fill-column: 78
73 #   indent-tabs-mode: nil
74 #   c-indentation-style: bsd
75 # End:
76 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :