diff --git a/compiler/testData/integration/ant/jvm/doNotIncludeRuntimeByDefault/test.kt b/compiler/testData/integration/ant/jvm/doNotIncludeRuntimeByDefault/test.kt index 700dece245f..4742e5b0fa3 100644 --- a/compiler/testData/integration/ant/jvm/doNotIncludeRuntimeByDefault/test.kt +++ b/compiler/testData/integration/ant/jvm/doNotIncludeRuntimeByDefault/test.kt @@ -4,11 +4,12 @@ import java.util.jar.JarFile fun main(args: Array) { val jar = File(args[0]) // if "includeRuntime" is specified to be true - var specifiedBeTrue = args[1].toBoolean() - for (entry in JarFile(jar).entries()) { - if (!specifiedBeTrue && entry.name.startsWith("kotlin/")) { - println("Error: Kotlin runtime is expected to be excluded if the attribute \"includeRuntime\" is not specified to be true") - break; - } + var shouldIncludeRuntime = args[1].toBoolean() + val hasKotlinPackage = JarFile(jar).entries().toList().any { it.name.startsWith("kotlin/") } + if (shouldIncludeRuntime != hasKotlinPackage) { + println( + "Error: Kotlin runtime is expected to be included only if the attribute \"includeRuntime\" is specified to be true\n" + + "includeRuntime = ${shouldIncludeRuntime}; hasKotlinPackage = $hasKotlinPackage" + ) } }