diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-06-22 07:38:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-22 07:38:08 +0200 |
| commit | f50bdb0f328e0c853f97521b12c3618b1af55e0b (patch) | |
| tree | ec7eb27175c1a00a2f6199a012d69c152a082c3c /tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs | |
| parent | 026d8d28b7e7e0aea54426eff05419e2bfc735a0 (diff) | |
| parent | db716bde95e6c14afc48d1343fc74ddbbd2ad97e (diff) | |
Merge pull request #6204 from Bond-009/extensions
Diffstat (limited to 'tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs')
| -rw-r--r-- | tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs b/tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs new file mode 100644 index 000000000..d1aa2e476 --- /dev/null +++ b/tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs @@ -0,0 +1,18 @@ +using System; +using Xunit; + +namespace Jellyfin.Extensions.Tests +{ + public class StringExtensionsTests + { + [Theory] + [InlineData("", '_', 0)] + [InlineData("___", '_', 3)] + [InlineData("test\x00", '\x00', 1)] + [InlineData("Imdb=tt0119567|Tmdb=330|TmdbCollection=328", '|', 2)] + public void ReadOnlySpan_Count_Success(string str, char needle, int count) + { + Assert.Equal(count, str.AsSpan().Count(needle)); + } + } +} |
