Skip to content

Commit

Permalink
fix wrong test results for zero-point mandatory tests (fixes #60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feuermagier committed Oct 17, 2024
1 parent 8730d7a commit 6aa0d96
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ public TestCasePanel() {
for (var result : testResults) {
String tooltip = result.getDetailText().orElse("No details available");

var icon = result.getPoints() != 0.0
? AllIcons.RunConfigurations.TestPassed
: AllIcons.RunConfigurations.TestFailed;
// isPositive() is true if the test passed, regardless of its points
// (which may be zero for mandatory tests)
var icon = result.getPositive()
.map(p -> p ? AllIcons.RunConfigurations.TestPassed : AllIcons.RunConfigurations.TestFailed)
.orElse(AllIcons.RunConfigurations.TestUnknown);
var iconLabel = new JBLabel(icon);
iconLabel.setToolTipText(tooltip);
this.content.add(iconLabel);
Expand Down

0 comments on commit 6aa0d96

Please sign in to comment.