-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
ctg-bugIssue is a bugIssue is a buglang-kotlinIssue is related to Kotlin language supportIssue is related to Kotlin language support
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
Labels
ctg-bugIssue is a bugIssue is a buglang-kotlinIssue is related to Kotlin language supportIssue is related to Kotlin language support
Type
Projects
Status
Todo