Skip to content

Commit cffb2f4

Browse files
committed
StepHarness should operate on the post-roundtripped set, not the pre-roundtripped.
1 parent 83850bf commit cffb2f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testlib/src/main/java/com/diffplug/spotless/StepHarnessBase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ enum RoundTrip {
2727
private final Formatter formatter;
2828

2929
protected StepHarnessBase(Formatter formatter, RoundTrip roundTrip) {
30-
this.formatter = Objects.requireNonNull(formatter);
3130
if (roundTrip == RoundTrip.DONT_ROUNDTRIP) {
31+
this.formatter = Objects.requireNonNull(formatter);
3232
return;
3333
}
3434
Formatter roundTripped = SerializableEqualityTester.reserialize(formatter);
3535
if (roundTrip == RoundTrip.ASSERT_EQUAL) {
3636
Assertions.assertThat(roundTripped).isEqualTo(formatter);
3737
}
38+
this.formatter = roundTripped;
3839
}
3940

4041
protected Formatter formatter() {

0 commit comments

Comments
 (0)