Skip to content

Commit ee27905

Browse files
authored
Add extra deepequals test (#698)
1 parent 71bbb07 commit ee27905

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

utbot-framework/src/test/kotlin/org/utbot/examples/codegen/deepequals/DeepEqualsTest.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,13 @@ class DeepEqualsTest : UtValueTestCaseChecker(
164164
coverage = DoNotCalculate
165165
)
166166
}
167+
168+
@Test
169+
fun testClassWithNullableField() {
170+
check(
171+
ClassWithNullableField::returnCompoundWithNullableField,
172+
eq(2),
173+
coverage = DoNotCalculate
174+
)
175+
}
167176
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.utbot.examples.codegen.deepequals;
2+
3+
class Component {
4+
int a = 1;
5+
}
6+
7+
class Compound {
8+
Component component;
9+
10+
Compound(Component component) {
11+
this.component = component;
12+
}
13+
}
14+
15+
public class ClassWithNullableField {
16+
public Compound returnCompoundWithNullableField(int value) {
17+
if (value > 0) return new Compound(null);
18+
else return new Compound(new Component());
19+
}
20+
}

0 commit comments

Comments
 (0)