Skip to content

Commit

Permalink
test(spdx-utils): Add a test for semantic matching of given express…
Browse files Browse the repository at this point in the history
…ions

Resolves #7186.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 25, 2024
1 parent 2616e9e commit 96c8b19
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions utils/spdx/src/test/kotlin/SpdxExpressionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,18 @@ class SpdxExpressionTest : WordSpec({

result shouldBe "a AND (c OR d) AND a".toSpdx()
}

"given expressions should match semantically equivalent license expressions" {
val expression = "a OR b".toSpdx()

val choices = listOf(
SpdxLicenseChoice("b OR a".toSpdx(), "a".toSpdx())
)

val result = expression.applyChoices(choices)

result shouldBe "a".toSpdx()
}
}

"equals()" should {
Expand Down

0 comments on commit 96c8b19

Please sign in to comment.