-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Assignees
@tyuldashev
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) ...
Visual proofs (screenshots, logs, images)
image
Metadata
Metadata
Assignees
Type
Projects
Status
Todo