Skip to content

Commit 8a3e5c6

Browse files
committed
chore(model): Improve the failure message when checking references
Use a more readable representation of IDs. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 1cefddb commit 8a3e5c6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

model/src/main/kotlin/utils/DependencyGraphBuilder.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,9 @@ class DependencyGraphBuilder<D>(
202202

203203
private fun checkReferences() {
204204
require(resolvedPackages.keys.containsAll(validPackageDependencies)) {
205+
val danglingIds = validPackageDependencies - resolvedPackages.keys
205206
"The following references do not actually refer to packages: " +
206-
"${validPackageDependencies - resolvedPackages.keys}."
207+
danglingIds.joinToString(postfix = ".") { "'${it.toCoordinates()}'" }
207208
}
208209

209210
val packageReferencesKeysWithMultipleDistinctPackageReferences = references.groupBy { it.key }.filter {

model/src/test/kotlin/utils/DependencyGraphBuilderTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class DependencyGraphBuilderTest : WordSpec({
223223
.build()
224224
}
225225

226-
exception.message shouldContain depNoPkg.id.toString()
226+
exception.message shouldContain depNoPkg.id.toCoordinates()
227227
}
228228

229229
"take issues into account when checking for illegal references" {

0 commit comments

Comments
 (0)