diff options
| author | Bond_009 <bond.009@outlook.com> | 2020-01-11 21:16:36 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2020-01-11 22:17:05 +0100 |
| commit | cd0592ea8f4a373a4318d2aba42349a1b89d4b32 (patch) | |
| tree | bbc15bafd9914cb05247a37e97b9fc3a7d5bf1fe /tests | |
| parent | dd254eddac4b805f0020e5899fb903ef10714527 (diff) | |
Improve parsers
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Naming.Tests/Video/CleanStringTests.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/Jellyfin.Naming.Tests/Video/CleanStringTests.cs b/tests/Jellyfin.Naming.Tests/Video/CleanStringTests.cs index 7c3270ebc..fde06c5a1 100644 --- a/tests/Jellyfin.Naming.Tests/Video/CleanStringTests.cs +++ b/tests/Jellyfin.Naming.Tests/Video/CleanStringTests.cs @@ -1,4 +1,5 @@ -using Emby.Naming.Common; +using System; +using Emby.Naming.Common; using Emby.Naming.Video; using Xunit; @@ -30,8 +31,15 @@ namespace Jellyfin.Naming.Tests.Video // FIXME: [InlineData("After The Sunset - [0004].mkv", "After The Sunset")] public void CleanStringTest(string input, string expectedName) { - var result = new VideoResolver(_namingOptions).CleanString(input); - Assert.Equal(expectedName, result.Name); + if (new VideoResolver(_namingOptions).TryCleanString(input, out ReadOnlySpan<char> newName)) + { + // TODO: compare spans when XUnit supports it + Assert.Equal(expectedName, newName.ToString()); + } + else + { + Assert.Equal(expectedName, input); + } } } } |
