-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Assignees
@tyuldashev
Description
Description
In case user have functions with vararg
UTBot tries to pass Array as parameter which doesn't work
To Reproduce
Steps to reproduce the behavior:
- In UTBot settings set
Generated test language
toKotlin
other leave default - Generate tests for following code
class VarArgs { fun sum(vararg ints:Int): Int { var sum: Int = 0 for (i in ints) sum += i return sum } }
Expected behavior
Compilable tests are supposed to be generated.
Actual behavior
Generated tests are not compilalbe and look like:
@Test fun testSum1() { val varArgs = VarArgs() val ints = intArrayOf(1, 1409199696, 1) val actual = varArgs.sum(ints) assertEquals(1409199698, actual) }
Visual proofs (screenshots, logs, images)
Metadata
Metadata
Type
Projects
Status
Todo