From 5d534ad6ee8fe3c7b66d3e3b1223ce93b3ecfbec Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 18 Dec 2024 17:13:51 +0100 Subject: [PATCH] test(spdx-utils): Simplify comparing a string representation With sorting applied, the string representation can be hard-coded. Signed-off-by: Sebastian Schuberth --- utils/spdx/src/test/kotlin/SpdxCompoundExpressionTest.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/utils/spdx/src/test/kotlin/SpdxCompoundExpressionTest.kt b/utils/spdx/src/test/kotlin/SpdxCompoundExpressionTest.kt index 7c3f93479fc41..951fa3d05bcdd 100644 --- a/utils/spdx/src/test/kotlin/SpdxCompoundExpressionTest.kt +++ b/utils/spdx/src/test/kotlin/SpdxCompoundExpressionTest.kt @@ -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" {