Skip to content

Commit 1582e37

Browse files
[literal-comparison] Cleanup of identical/duplicated functional tests
1 parent 19b4fda commit 1582e37

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

tests/functional/c/comparison_of_constants.py

-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# pylint: disable=missing-docstring, comparison-with-itself, invalid-name
22

3-
4-
if 2 is 2: # [literal-comparison, comparison-of-constants]
5-
pass
6-
73
while 2 == 2: # [comparison-of-constants]
84
pass
95

@@ -22,14 +18,6 @@
2218

2319
CONST = 24
2420

25-
if CONST is 0: # [literal-comparison]
26-
pass
27-
28-
if CONST is 1: # [literal-comparison]
29-
pass
30-
31-
if CONST is 42: # [literal-comparison]
32-
pass
3321

3422
if 0 < CONST < 42:
3523
pass
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
comparison-of-constants:4:3:4:9::"Comparison between constants: '2 is 2' has a constant value":HIGH
2-
literal-comparison:4:3:4:9::In '2 is 2', use '==' when comparing constant literals not 'is' ('2 == 2'):HIGH
3-
comparison-of-constants:7:6:7:12::"Comparison between constants: '2 == 2' has a constant value":HIGH
4-
comparison-of-constants:10:6:10:11::"Comparison between constants: '2 > 2' has a constant value":HIGH
5-
comparison-of-constants:20:3:20:15::"Comparison between constants: 'True == True' has a constant value":HIGH
6-
singleton-comparison:20:3:20:15::Comparison 'True == True' should be 'True is True' if checking for the singleton value True, or 'True' if testing for truthiness:UNDEFINED
7-
literal-comparison:25:3:25:13::In 'CONST is 0', use '==' when comparing constant literals not 'is' ('CONST == 0'):HIGH
8-
literal-comparison:28:3:28:13::In 'CONST is 1', use '==' when comparing constant literals not 'is' ('CONST == 1'):HIGH
9-
literal-comparison:31:3:31:14::In 'CONST is 42', use '==' when comparing constant literals not 'is' ('CONST == 42'):HIGH
1+
comparison-of-constants:3:6:3:12::"Comparison between constants: '2 == 2' has a constant value":HIGH
2+
comparison-of-constants:6:6:6:11::"Comparison between constants: '2 > 2' has a constant value":HIGH
3+
comparison-of-constants:16:3:16:15::"Comparison between constants: 'True == True' has a constant value":HIGH
4+
singleton-comparison:16:3:16:15::Comparison 'True == True' should be 'True is True' if checking for the singleton value True, or 'True' if testing for truthiness:UNDEFINED

0 commit comments

Comments
 (0)