KT-64719 K2 KAPT stub generation should fail on syntax errors
This commit is contained in:
committed by
Space Team
parent
bace053ea9
commit
894df8f641
+13
@@ -37,6 +37,7 @@ import java.util.zip.ZipOutputStream
|
||||
import kotlin.io.path.appendText
|
||||
import kotlin.io.path.deleteExisting
|
||||
import kotlin.io.path.outputStream
|
||||
import kotlin.io.path.writeText
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
abstract class Kapt3BaseIT : KGPBaseTest() {
|
||||
@@ -1448,4 +1449,16 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@DisplayName("KT-64719 KAPT stub generation should fail on files with syntax errors")
|
||||
@GradleTest
|
||||
fun testTopLevelSyntaxError(gradleVersion: GradleVersion) {
|
||||
project("simple".withPrefix, gradleVersion) {
|
||||
javaSourcesDir().resolve("invalid.kt").writeText("fun foo() { !!! }")
|
||||
|
||||
buildAndFail(":kaptGenerateStubsKotlin") {
|
||||
assertOutputContains("invalid.kt:1:16 Expecting an element")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user