Skip to content

Commit 105615c

Browse files
committed
Do not run compilation on Kotlin tests on lambdas due to generics issues
1 parent 848f660 commit 105615c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/CustomPredicateExampleTest.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
package org.utbot.examples.lambda
22

33
import org.junit.jupiter.api.Test
4+
import org.utbot.framework.plugin.api.CodegenLanguage
45
import org.utbot.testcheckers.eq
6+
import org.utbot.tests.infrastructure.CodeGeneration
57
import org.utbot.tests.infrastructure.DoNotCalculate
68
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
79
import org.utbot.tests.infrastructure.isException
810

9-
class CustomPredicateExampleTest : UtValueTestCaseChecker(testClass = CustomPredicateExample::class) {
11+
class CustomPredicateExampleTest : UtValueTestCaseChecker(
12+
testClass = CustomPredicateExample::class,
13+
languagePipelines = listOf(
14+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
15+
// TODO: https://github.com/UnitTestBot/UTBotJava/issues/88 (generics in Kotlin)
16+
// At the moment, when we create an instance of a functional interface via lambda (through reflection),
17+
// we need to do a type cast (e.g. `obj as Predicate<Int>`), but since generics are not supported yet,
18+
// we use a raw type (e.g. `Predicate`) instead (which is not allowed in Kotlin).
19+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
20+
)
21+
) {
1022
@Test
1123
fun testNoCapturedValuesPredicateCheck() {
1224
checkWithException(

0 commit comments

Comments
 (0)