Skip to content

Commit

Permalink
PackageCurationTest: Test applicability with an empty name / version
Browse files Browse the repository at this point in the history
This is in context of [1].

[1]: #5105 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Oct 20, 2022
1 parent fee548f commit a949115
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions model/src/test/kotlin/PackageCurationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.ossreviewtoolkit.model

import io.kotest.assertions.assertSoftly
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.collections.containExactlyInAnyOrder
Expand Down Expand Up @@ -409,6 +410,23 @@ class PackageCurationTest : WordSpec({
}

"isApplicable()" should {
"accept an empty name and / or version" {
val curation = PackageCuration(
id = Identifier("Maven:com.android.tools"),
data = PackageCurationData(
authors = sortedSetOf("The Android Open Source Project"),
concludedLicense = "Apache-2.0".toSpdx()
)
)

assertSoftly {
curation.isApplicable(Identifier("Maven:com.android.tools:common:25.3.0")) shouldBe true
curation.isApplicable(Identifier("Maven:com.android.tools:common")) shouldBe true
curation.isApplicable(Identifier("Maven:com.android.tools::25.3.0")) shouldBe true
curation.isApplicable(Identifier("Maven:com.android.tools")) shouldBe true
}
}

"comply to the ivy version matchers specifications" {
packageCurationForVersion("[1.0.0,2.0.0]").isApplicable(identifierForVersion("1.0.0")) shouldBe true
packageCurationForVersion("[1.0.0,2.0.0]").isApplicable(identifierForVersion("1.23")) shouldBe true
Expand Down

0 comments on commit a949115

Please sign in to comment.