Skip to content

Commit

Permalink
Добавил дымовой тест для extraMinForComplexity >= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
theshadowco committed Jan 13, 2024
1 parent 15299b6 commit 9503336
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ public boolean canLocateOnProject() {
}

public double getExtraMinForComplexity() {
if (diagnosticMetadata.extraMinForComplexity() > 0) {
return diagnosticMetadata.extraMinForComplexity();
}
return 0;
return diagnosticMetadata.extraMinForComplexity();
}

public Map<String, Object> getDefaultConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,13 @@ void testIAllDiagnostics() {
assertThat(diagnosticErrors).isEmpty();
}

@Test
void testExtraMinForComplexity() {
// нельзя ставить отрицательное значение
diagnosticInfos.forEach(diagnosticInfo ->
assertThat(diagnosticInfo.getExtraMinForComplexity())
.as(diagnosticInfo.getCode().getStringValue())
.isNotNegative()
);
}
}

0 comments on commit 9503336

Please sign in to comment.