Skip to content

Commit

Permalink
test(spdx-utils): Simplify comparing a string representation
Browse files Browse the repository at this point in the history
With sorting applied, the string representation can be hard-coded.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Dec 18, 2024
1 parent 6b68dd8 commit 5d534ad
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions utils/spdx/src/test/kotlin/SpdxCompoundExpressionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,7 @@ class SpdxCompoundExpressionTest : WordSpec({
)

// Compare string representations to not rely on semantic equality.
expression.simplify().toString() shouldBe SpdxCompoundExpression(
SpdxOperator.AND,
listOf(
SpdxLicenseIdExpression("MIT"),
SpdxLicenseIdExpression("Apache-2.0")
)
).toString()
expression.simplify().sorted().toString() shouldBe "Apache-2.0 AND MIT"
}

"create a single expression for equal operands" {
Expand Down

0 comments on commit 5d534ad

Please sign in to comment.