Skip to content

Commit

Permalink
test(spdx-utils): Add a test for a complex license choice
Browse files Browse the repository at this point in the history
See [1] for context.

[1]: #8082 (comment)

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Jan 15, 2024
1 parent 6cebe0e commit 3892bd3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/spdx/src/test/kotlin/SpdxExpressionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,13 @@ class SpdxExpressionTest : WordSpec({
spdxExpression.isValidChoice("a AND b AND d".toSpdx()) shouldBe false
spdxExpression.isValidChoice("a AND b AND c AND d".toSpdx()) shouldBe false
}

"return true for a simplified choice for a complex expression" {
val license = "(MIT OR GPL-2.0-only) AND (MIT OR BSD-3-Clause OR GPL-1.0-or-later) AND " +
"(MIT OR BSD-3-Clause OR GPL-2.0-only)"

license.toSpdx().isValidChoice("MIT".toSpdx()) shouldBe true
}
}

"applyChoice()" should {
Expand Down

0 comments on commit 3892bd3

Please sign in to comment.