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 e63f12b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 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,24 @@ class PackageCurationTest : WordSpec({
}

"isApplicable()" should {
"accept an empty name and / or version" {
val curation = PackageCuration(
id = Identifier("Maven:com.android.tools"),

// Hint: Curation data could set authors and a concluded license here to implement the concept of a
// "trusted framework" (as [identified][id] by only the type and namespace) with
// [ScannerConfiguration.skipConcluded] enabled.
data = PackageCurationData()
)

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 e63f12b

Please sign in to comment.