mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Some more test cases for CleanTitle
This commit is contained in:
@@ -61,7 +61,11 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|||||||
[TestCase("Marvel's Agents of S.H.I.E.L.D.", "Marvels Agents of S.H.I.E.L.D")]
|
[TestCase("Marvel's Agents of S.H.I.E.L.D.", "Marvels Agents of S.H.I.E.L.D")]
|
||||||
[TestCase("Castle (2009)", "Castle 2009")]
|
[TestCase("Castle (2009)", "Castle 2009")]
|
||||||
[TestCase("Law & Order (UK)", "Law and Order UK")]
|
[TestCase("Law & Order (UK)", "Law and Order UK")]
|
||||||
// [TestCase("", "")]
|
[TestCase("Is this okay?", "Is this okay")]
|
||||||
|
[TestCase("[a] title", "a title")]
|
||||||
|
[TestCase("backslash \\ backlash", "backslash backlash")]
|
||||||
|
//[TestCase("", "")]
|
||||||
|
//[TestCase("", "")]
|
||||||
public void should_get_expected_title_back(string title, string expected)
|
public void should_get_expected_title_back(string title, string expected)
|
||||||
{
|
{
|
||||||
_series.Title = title;
|
_series.Title = title;
|
||||||
|
@@ -56,7 +56,7 @@ namespace NzbDrone.Core.Organizer
|
|||||||
private static readonly Regex FileNameCleanupRegex = new Regex(@"([- ._])(\1)+", RegexOptions.Compiled);
|
private static readonly Regex FileNameCleanupRegex = new Regex(@"([- ._])(\1)+", RegexOptions.Compiled);
|
||||||
private static readonly Regex TrimSeparatorsRegex = new Regex(@"[- ._]$", RegexOptions.Compiled);
|
private static readonly Regex TrimSeparatorsRegex = new Regex(@"[- ._]$", RegexOptions.Compiled);
|
||||||
|
|
||||||
private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`|~|!|@|$|%|^|&|\*|-|_|=){1}(?=\s)|('|:)(?=s|\s)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`|~|!|\?|@|$|%|^|\*|-|_|=){1}(?=\s)|('|:|\?)(?=s|\s|$)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
private static readonly Regex ScenifyReplaceChars = new Regex(@"[\/]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
private static readonly Regex ScenifyReplaceChars = new Regex(@"[\/]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
private static readonly char[] EpisodeTitleTrimCharacters = new[] { ' ', '.', '?' };
|
private static readonly char[] EpisodeTitleTrimCharacters = new[] { ' ', '.', '?' };
|
||||||
|
Reference in New Issue
Block a user