Skip to content

Commit cb6bd6e

Browse files
committed
Added unit tests for changes to Squiz.Operator.ComparisonOperatorUsage with JS tokenizer
1 parent a7de9ec commit cb6bd6e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

CodeSniffer/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,21 @@ if (one === TRUE || two === TRUE || three === FALSE || four === TRUE) {
3636

3737
if (one || two || !three || four) {
3838
}
39+
40+
while (one == true) {
41+
}
42+
43+
while (one === true) {
44+
}
45+
46+
do {
47+
} while (one == true);
48+
49+
do {
50+
} while (one === true);
51+
52+
for (one = 10; one != 0; one--) {
53+
}
54+
55+
for (one = 10; one !== 0; one--) {
56+
}

CodeSniffer/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public function getErrorList($testFile='ComparisonOperatorUsageUnitTest.inc')
8080
17 => 1,
8181
18 => 1,
8282
28 => 2,
83+
40 => 1,
84+
47 => 1,
85+
52 => 1,
8386
);
8487
break;
8588
default:

0 commit comments

Comments
 (0)