diff --git a/model/src/test/kotlin/utils/FindingsMatcherTest.kt b/model/src/test/kotlin/utils/FindingsMatcherTest.kt index 04cbe78ddf457..b7a118d195bd4 100644 --- a/model/src/test/kotlin/utils/FindingsMatcherTest.kt +++ b/model/src/test/kotlin/utils/FindingsMatcherTest.kt @@ -19,6 +19,7 @@ package org.ossreviewtoolkit.model.utils +import io.kotest.assertions.assertSoftly import io.kotest.core.spec.IsolationMode import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.collections.beEmpty @@ -290,27 +291,29 @@ class FindingsMatcherTest : WordSpec() { } "associate licenses and exceptions from the same expression" { - associateLicensesWithExceptions( - "MIT OR (GPL-2.0-only AND CC-BY-3.0 AND GCC-exception-2.0)".toSpdx() - ) shouldBe "MIT OR (GPL-2.0-only WITH GCC-exception-2.0 AND CC-BY-3.0)".toSpdx() - - associateLicensesWithExceptions( - "MIT OR (0BSD AND CC-BY-3.0 AND GCC-exception-2.0)".toSpdx() - ) shouldBe "MIT OR (0BSD AND CC-BY-3.0 AND NOASSERTION WITH GCC-exception-2.0)".toSpdx() - - associateLicensesWithExceptions( - "(BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0) AND (GPL-2.0-only AND GCC-exception-2.0)" - .toSpdx() - ) shouldBe "BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0".toSpdx() - - associateLicensesWithExceptions( - "GPL-2.0-only AND GPL-3.0-only AND Bootloader-exception AND Classpath-exception-2.0".toSpdx() - ) shouldBe ( - "GPL-2.0-only WITH Bootloader-exception AND " + - "GPL-3.0-only WITH Bootloader-exception AND " + - "GPL-2.0-only WITH Classpath-exception-2.0 AND " + - "GPL-3.0-only WITH Classpath-exception-2.0" - ).toSpdx() + assertSoftly { + associateLicensesWithExceptions( + "MIT OR (GPL-2.0-only AND CC-BY-3.0 AND GCC-exception-2.0)".toSpdx() + ) shouldBe "MIT OR (GPL-2.0-only WITH GCC-exception-2.0 AND CC-BY-3.0)".toSpdx() + + associateLicensesWithExceptions( + "MIT OR (0BSD AND CC-BY-3.0 AND GCC-exception-2.0)".toSpdx() + ) shouldBe "MIT OR (0BSD AND CC-BY-3.0 AND NOASSERTION WITH GCC-exception-2.0)".toSpdx() + + associateLicensesWithExceptions( + @Suppress("MaxLineLength") + "(BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0) AND (GPL-2.0-only AND GCC-exception-2.0)".toSpdx() + ) shouldBe "BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0".toSpdx() + + associateLicensesWithExceptions( + "GPL-2.0-only AND GPL-3.0-only AND Bootloader-exception AND Classpath-exception-2.0".toSpdx() + ) shouldBe ( + "GPL-2.0-only WITH Bootloader-exception AND " + + "GPL-3.0-only WITH Bootloader-exception AND " + + "GPL-2.0-only WITH Classpath-exception-2.0 AND " + + "GPL-3.0-only WITH Classpath-exception-2.0" + ).toSpdx() + } } } }