Skip to content

Commit

Permalink
test(spdx-utils): Remove obsolete tests
Browse files Browse the repository at this point in the history
For SPDX expressions it makes no semantic difference if the `AND` and
`OR` operators are left- or right-associative. With the changes from the
previous commit it also makes no structural difference anymore, so
remove the obsolete tests for the left associativity of operators.

Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher committed Feb 26, 2024
1 parent cb6854a commit bf5c15e
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions utils/spdx/src/test/kotlin/SpdxExpressionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -335,30 +335,6 @@ class SpdxExpressionTest : WordSpec({
actualExpression shouldBe expectedExpression
}

"bind the and operator left associative" {
val actualExpression = "license1 AND license2 AND license3".toSpdx()
val expectedExpression = SpdxCompoundExpression(
SpdxOperator.AND,
SpdxLicenseIdExpression("license1"),
SpdxLicenseIdExpression("license2"),
SpdxLicenseIdExpression("license3")
)

actualExpression shouldBe expectedExpression
}

"bind the or operator left associative" {
val actualExpression = "license1 OR license2 OR license3".toSpdx()
val expectedExpression = SpdxCompoundExpression(
SpdxOperator.OR,
SpdxLicenseIdExpression("license1"),
SpdxLicenseIdExpression("license2"),
SpdxLicenseIdExpression("license3")
)

actualExpression shouldBe expectedExpression
}

"respect parentheses for binding strength of operators" {
val actualExpression = "(license1 OR license2) AND license3".toSpdx()
val expectedExpression = SpdxCompoundExpression(
Expand Down

0 comments on commit bf5c15e

Please sign in to comment.