Skip to content

Commit

Permalink
fix(processor): What If not getting processed correctly (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxencs authored Dec 30, 2023
1 parent e23124b commit 8b8b17a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/processor/title.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func processTitle(title string, matchRelease bool) []string {
t := NewTitleSlice()

// Regex patterns
replaceRegexp := regexp.MustCompile(`[[:punct:]\s\x{00a0}\x{2000}-\x{200f}\x{2028}-\x{202f}\x{205f}-\x{206f}à-üÀ-Ü]`)
replaceRegexp := regexp.MustCompile(`[[:punct:]\s\x{00a0}\x{2000}-\x{200f}\x{2026}-\x{202f}\x{205f}-\x{206f}à-üÀ-Ü]`)
questionmarkRegexp := regexp.MustCompile(`[?]{2,}`)
regionCodeRegexp := regexp.MustCompile(`\(.+\)$`)
parenthesesEndRegexp := regexp.MustCompile(`\)$`)
Expand Down
8 changes: 8 additions & 0 deletions internal/processor/title_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ func Test_processTitle(t *testing.T) {
},
want: []string{"Whose?Line?Is?It?Anyway", "Whose?Line?Is?It?Anyway?", "Whose?Line?Is?It?Anyway*US*1932", "Whose?Line?Is?It?Anyway*US*1932?"},
},
{
name: "test_24",
args: args{
title: "What If…?",
matchRelease: false,
},
want: []string{"What?If", "What?If*"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 8b8b17a

Please sign in to comment.