Description
When user tries to generate parametrized test for Kotlin code as result she gets uncompilable code
To Reproduce
Steps to reproduce the behavior:
- Invoke test generation for the code below, with enabled setting
Parametrized tests
classA {
funf(a:Int, b:Int): Int {
return a + b;
}
}Expected behavior
Executable tests are generated
Actual behavior
Tests cannot be compiled and executed.
Visual proofs (screenshots, logs, images)
Resulted code and errors:

classATest {
///region Test suites for executable org.test.A.f///region Parameterized test for method f(int, int)
@ParameterizedTest
@MethodSource("org.test.ATest#provideDataForF")
funparameterizedTestsForF(a:A?,
a1:Int,
b:Int,
expectedResult:Int?
) {
val actual = a.f(a1, b) // #1 error
assertEquals(expectedResult, actual)
}
///endregion///endregioncompanionobject {
///region Data providers
@JvmStatic
funprovideDataForF(): java.util.ArrayList // #2 error
{
val argList = java.util.ArrayList() // #3 errorrun {
val a =A()
val testCaseObjects = kotlin.Array<Any?>(4) { null }
testCaseObjects[0] = a
testCaseObjects[1] =-1
testCaseObjects[2] =1
testCaseObjects[3] =0
argList.add(arguments(testCaseObjects))
}
return argList
}
///endregion
}
}
Description
When user tries to generate parametrized test for Kotlin code as result she gets uncompilable code
To Reproduce
Steps to reproduce the behavior:
Parametrized testsExpected behavior
Executable tests are generated
Actual behavior
Tests cannot be compiled and executed.
Visual proofs (screenshots, logs, images)
Resulted code and errors: