Skip to content

Commit

Permalink
test(ort-utils): Add more Copyright symbol tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 11, 2024
1 parent 0794697 commit 4336048
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion utils/ort/src/test/kotlin/CopyrightStatementsProcessorTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CopyrightStatementsProcessorTest : WordSpec({
actualResult shouldBe expectedResult
}

"group statements with uppercase (C)" {
"group statements with upper-case (C)" {
val statements = listOf(
"Copyright (C) 2017 The ORT Project Authors",
"Copyright (C) 2022 The ORT Project Authors"
Expand All @@ -52,5 +52,32 @@ class CopyrightStatementsProcessorTest : WordSpec({
actualResult.processedStatements.keys.first() shouldBe "Copyright (C) 2017, 2022 The ORT Project Authors"
actualResult.unprocessedStatements should beEmpty()
}

"group statements with lower-case (c)" {
val statements = listOf(
"Copyright (c) 2017 The ORT Project Authors",
"Copyright (c) 2022 The ORT Project Authors"
)

val actualResult = CopyrightStatementsProcessor.process(statements)

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

"not group statements with mixed-case (C) and (c)" {
val statements = listOf(
"Copyright (C) 2017 The ORT Project Authors",
"Copyright (c) 2022 The ORT Project Authors"
)

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.unprocessedStatements should beEmpty()
}
}
})

0 comments on commit 4336048

Please sign in to comment.