Open
Description
Description
In some cases UTBot generates test which has creation of actual and expected results but not their comparison. Currently I found that It affects usage of sorted
, sortedBy
, srotedDescending
and sortedByDescending
.
To Reproduce
Steps to reproduce the behavior:
- In UTBot settings set
Generated test language
toKotlin
- Generate tests for following code
class SortingList {
fun descending(list: List<Int>) = list.sortedDescending()
}
Expected behavior
Generated tests has assertions
Actual behavior
Generated test looks like that, it has actual and expected results, but they are not compared with each other.
@Test
@DisplayName("natural: arg_0 = ListSample()")
fun testNatural() {
val listSample = ListSample()
val actual = listSample.natural()
val expected = createInstance("java.util.Arrays\$ArrayList") ?: error("createInstance failed")
}
Additional context
createInstance("java.util.Arrays\$ArrayList")
construction also looks suspicious. Not sure if it's cause of described problem or separated problem.
Metadata
Metadata
Assignees
Type
Projects
Status
Todo