-
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
When user code has Set
as return type then UTBot tries to import internal kotlin.collections.EmptySet
to initialize actual value.
To Reproduce
Steps to reproduce the behavior:
- In UTBot settings set
Generated test language
toKotlin
- Generate tests for following code
class EmptySetProblem {
fun issuesWithEmptyDescription(issues: Set<String>): Set<String> {
return issues.filter { it.length < 5 }.toSet()
}
}
Expected behavior
Compilable tests are generated
Actual behavior
Generated tests cannot be executed because code has error
@Test
@DisplayName("issuesWithEmptyDescription: issues = test collection")
fun testIssuesWithEmptyDescription() {
val emptySetProblem = EmptySetProblem()
val issues = HashSet()
issues.add("aqyas")
issues.add("hxgvr")
issues.add("aqyas")
issues.add("yippo")
issues.add("aqyas")
val actual = (emptySetProblem.issuesWithEmptyDescription(issues) as EmptySet)
val expected = (createInstance("kotlin.collections.EmptySet") as EmptySet)
...
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