Login
Finally decided to move RequireConstantOnLeftSideOfEquality to
[gknop/Perl-Critic.git] / t / ValuesAndExpressions / RequireConstantOnLeftSideOfEquality.run
CommitLineData
57aab077
JRT
1## name basic pass
2## failures 0
3## cut
4
5if( 6 == $foo ){}
6if( 'bar' eq $foo ){}
7
8while( 6 == $foo ){}
9while( 'bar' eq $foo ){}
10
11unless( 6 == $foo ){}
12unless( 'bar' eq $foo ){}
13
14#-----------------------------------------------------------------------------
15## name basic failures
16## failures 6
17## cut
18
19if( $foo == 6 ){}
20if( $foo eq 'bar' ){}
21
22while( $foo == 6 ){}
23while( $foo eq 'bar' ){}
24
25unless( $foo == 6 ){}
26unless( $foo eq 'bar' ){}
27
28#-----------------------------------------------------------------------------
29## name with complex expressions on right hand side
30## TODO Not sure how to handle this
31## failures 3
32## cut
33
34if( $foo == foo() ){}
35if( $foo == (6+3+1) ){}
36if( $foo == $object->method() ){}