Skip to content

Commit

Permalink
test(utils): Improve assertions for the processed statements
Browse files Browse the repository at this point in the history
Stop making assertions about the ordering of the keys.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Jan 15, 2024
1 parent 2b230b8 commit 7032df2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions utils/ort/src/test/kotlin/CopyrightStatementsProcessorTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package org.ossreviewtoolkit.utils.ort

import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.collections.beEmpty
import io.kotest.matchers.maps.shouldHaveSize
import io.kotest.matchers.collections.containExactlyInAnyOrder
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe

Expand All @@ -48,8 +48,9 @@ class CopyrightStatementsProcessorTest : WordSpec({

val actualResult = CopyrightStatementsProcessor.process(statements)

actualResult.processedStatements shouldHaveSize 1
actualResult.processedStatements.keys.first() shouldBe "Copyright (C) 2017, 2022 The ORT Project Authors"
actualResult.processedStatements.keys should containExactlyInAnyOrder(
"Copyright (C) 2017, 2022 The ORT Project Authors"
)
actualResult.unprocessedStatements should beEmpty()
}

Expand All @@ -61,8 +62,9 @@ class CopyrightStatementsProcessorTest : WordSpec({

val actualResult = CopyrightStatementsProcessor.process(statements)

actualResult.processedStatements shouldHaveSize 1
actualResult.processedStatements.keys.first() shouldBe "Copyright (c) 2017, 2022 The ORT Project Authors"
actualResult.processedStatements.keys should containExactlyInAnyOrder(
"Copyright (c) 2017, 2022 The ORT Project Authors"
)
actualResult.unprocessedStatements should beEmpty()
}

Expand All @@ -74,9 +76,10 @@ class CopyrightStatementsProcessorTest : WordSpec({

val actualResult = CopyrightStatementsProcessor.process(statements)

actualResult.processedStatements shouldHaveSize 2
actualResult.processedStatements.keys.first() shouldBe "Copyright (C) 2017 The ORT Project Authors"
actualResult.processedStatements.keys.last() shouldBe "Copyright (c) 2022 The ORT Project Authors"
actualResult.processedStatements.keys should containExactlyInAnyOrder(
"Copyright (C) 2017 The ORT Project Authors",
"Copyright (c) 2022 The ORT Project Authors"
)
actualResult.unprocessedStatements should beEmpty()
}
}
Expand Down

0 comments on commit 7032df2

Please sign in to comment.