Skip to content

Commit

Permalink
Issue #10548: Migrate to Inline Config Parser in InnerAssignmentCheck…
Browse files Browse the repository at this point in the history
…Test
  • Loading branch information
shashwatj07 authored and romani committed Aug 18, 2021
1 parent 0b64c4d commit 1b326d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion pom.xml
Expand Up @@ -1760,7 +1760,6 @@

<exclude>**/SuppressWarningsHolderTest.class</exclude>

<exclude>**/InnerAssignmentCheckTest.class</exclude>

<exclude>**/LineCommentAtTheEndOfFileTest.class</exclude>

Expand Down
Expand Up @@ -61,16 +61,18 @@ public void testIt() throws Exception {
"92:19: " + getCheckMessage(MSG_KEY),
"181:22: " + getCheckMessage(MSG_KEY),
};
verify(checkConfig, getPath("InputInnerAssignment.java"), expected);
verifyWithInlineConfigParser(checkConfig,
getPath("InputInnerAssignment.java"), expected);
}

@Test
public void testLambdaExpression() throws Exception {
final DefaultConfiguration checkConfig =
createModuleConfig(InnerAssignmentCheck.class);
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputInnerAssignmentLambdaExpressions.java"),
expected);
verifyWithInlineConfigParser(checkConfig,
getPath("InputInnerAssignmentLambdaExpressions.java"),
expected);
}

@Test
Expand Down
Expand Up @@ -19,7 +19,7 @@ void innerAssignments()
int b;
int c;

a = b = c = 1; // violation
a = b = c = 1; // 2 violations

String s = Integer.toString(b = 2); // violation

Expand Down Expand Up @@ -47,8 +47,8 @@ public void demoBug1195047Comment3()
if ((bb = false)) {} // violation
for (int j = 0; (bb = false); j += 1) {} // violation
while ((bb = false)) {} // violation
i = (bb = false) ? (b = 2) : (b += 1); // violation
i = (b += 1) + (b -= 1); // violation
i = (bb = false) ? (b = 2) : (b += 1); // 3 violations
i = (b += 1) + (b -= 1); // 2 violations
do {i += 1;} while (bb = false); // violation
}

Expand Down

0 comments on commit 1b326d6

Please sign in to comment.