Skip to content

Commit

Permalink
Add test error logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed May 16, 2024
1 parent 616ce37 commit 5584478
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import java.util.LinkedList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -87,10 +88,19 @@ public void testDial(
return x == 2.0;
});

final var rawValue = new AtomicReference<Double>();

FxAssert.verifyThat(dial, node -> {
final var x = node.rawValue().get();
rawValue.set(Double.valueOf(x));

final var rounded = Math.floor(x * 100.0) / 100.0;
return rounded == 0.16;
}, sb -> {
sb.append(" (Raw value ");
sb.append(rawValue.get());
sb.append(" must be close to 0.16)");
return sb;
});
}

Expand Down

0 comments on commit 5584478

Please sign in to comment.