You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
passes under JUnit assertions. However, this is re-written as
byte b = (byte) 0;
assertThat(b).isEqualTo(0);
and this fails in AssertJ assertions, because the 0 there is an int, not a byte.
What did you want to happen?
The check notes that the variable being asserted on is a byte, and thus casts the integer to a byte
byte b = (byte) 0;
assertThat(b).isEqualTo((byte) 0);
There is a related case I don't know how/if you want to deal with something like
byte b = (byte) 0;
assertNotEquals(b, 88888888); // wat
since the naïve impl will not compile. Maybe just remove the line since it's always going to be true? (Someone somewhere who uses that kind of code to throw an AssertionError is screaming at me...)
The text was updated successfully, but these errors were encountered:
What happened?
Code of the form
passes under JUnit assertions. However, this is re-written as
and this fails in AssertJ assertions, because the
0
there is an int, not a byte.What did you want to happen?
The check notes that the variable being asserted on is a byte, and thus casts the integer to a byte
There is a related case I don't know how/if you want to deal with something like
since the naïve impl will not compile. Maybe just remove the line since it's always going to be true? (Someone somewhere who uses that kind of code to throw an
AssertionError
is screaming at me...)The text was updated successfully, but these errors were encountered: