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
Also generation for examples.objects.AbstractAnonymousClass#getInstance from UTBot Java project could be used to demonstrate the problem. Here is one of generated test:
@Test@DisplayName("getInstance: x % 2 == 0 : False -> return new AbstractAnonymousClass() { @Override int constValue() { return 42 } @Override int add(int x) { return x + 15 } @Override public int methodWithOverride(int x, int y) { return x + 37 } }")
publicvoidtestGetInstance_XRemainderOf2NotEqualsZero() throwsException {
AbstractAnonymousClassactual = AbstractAnonymousClass.getInstance(-255);
AbstractAnonymousClassexpected = ((AbstractAnonymousClass) createInstance("examples.objects.AbstractAnonymousClass$1"));
}
Description
If a method returns an anonymous class, the generated test method contains actual and expected, but doesn't assert them to be equal.
To Reproduce
Expected behavior
Test is supposed to contain assert of expected and actual value.
Actual behavior
Test contains actual and expected fields, but there is no assertion.
Visual proofs (screenshots, logs, images)
Environment
Windows 10 Pro
JDK 8
Additional context
The same issue can be seen for generating tests for the following code:
The text was updated successfully, but these errors were encountered: