Skip to content

Commit

Permalink
test: fix digimon for short name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziedelth committed Sep 10, 2024
1 parent b567658 commit 199b171
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/fr/shikkanime/utils/StringUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import java.util.regex.Pattern
object StringUtils {
private val nonLatinPattern: Pattern = Pattern.compile("[^\\w-]")
private val whitespacePattern: Pattern = Pattern.compile("\\s|:\\b|\\.\\b|/\\b|&\\b")
private val regex = "( [-|!].*[-|!])|( Saison \\d*)|\\(\\d*\\)".toRegex()
private val regex = "( [-|!].*[-|!])|( Saison \\d*)|(?:: )?\\(\\d*\\)".toRegex()
private val separators = listOf(":", ",", "!", "", " so ", " - ")

private fun isAllPartsHaveSameAmountOfWords(parts: List<String>): Boolean {
Expand Down
2 changes: 2 additions & 0 deletions src/test/kotlin/fr/shikkanime/utils/StringUtilsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class StringUtilsTest {
"CARDFIGHT!! VANGUARD overDress" to "CARDFIGHT!! VANGUARD overDress",
"Re:ZERO –Starting Life in Another World–" to "Re:ZERO",
"Arifureta: From Commonplace to World's Strongest" to "Arifureta",
"Digimon Adventure: (2020)" to "Digimon Adventure",
"Kenshin le vagabond (2023)" to "Kenshin le vagabond",
)

list.forEach { (input, expected) ->
Expand Down

0 comments on commit 199b171

Please sign in to comment.