From e6f04c84fae83eb22b82afe5ce9db5d84749078e Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 8 Jun 2022 15:52:11 +0200 Subject: [PATCH] [Gradle][MPP] Increase test failure readability in reportSourceSetCommonizerDependencies --- .../util/reportSourceSetCommonizerDependencies.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/reportSourceSetCommonizerDependencies.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/reportSourceSetCommonizerDependencies.kt index ce02a44d1b3..487b39c5a7d 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/reportSourceSetCommonizerDependencies.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/reportSourceSetCommonizerDependencies.kt @@ -92,12 +92,20 @@ data class SourceSetCommonizerDependencies( if (unmatchedDependencies.isNotEmpty() || unmatchedMatchers.isNotEmpty()) { fail(buildString { + fun appendLineIndented(value: Any?) = appendLine(value.toString().prependIndent(" ")) + appendLine("$sourceSetName: Set of commonizer dependencies does not match given 'fileMatchers'") if (unmatchedDependencies.isNotEmpty()) { - appendLine("Unmatched dependencies: $unmatchedDependencies") + appendLine("Unmatched dependencies:") + unmatchedDependencies.forEach { dependency -> + appendLineIndented(dependency) + } } if (unmatchedMatchers.isNotEmpty()) { - appendLine("Unmatched fileMatchers: $unmatchedMatchers") + appendLine("Unmatched fileMatchers:") + unmatchedMatchers.forEach { matcher -> + appendLineIndented(matcher) + } } }) }