aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2021-06-20 07:09:24 -0600
committercrobibero <cody@robibe.ro>2021-06-20 07:09:24 -0600
commit23dd6e2d9fdcb65f3ca13914c83f8ffbbd7e1743 (patch)
tree38e905846e02da5e255b1ef23ea27a749b53c453 /tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs
parent078b6244ee060b2c5caddc3ba8a60633c4e95054 (diff)
parent0c3dcdf77b0d124517bffa608bfddf7d8f7682db (diff)
Merge remote-tracking branch 'upstream/master' into baseitemkind-fixes
Diffstat (limited to 'tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs')
-rw-r--r--tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs b/tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs
new file mode 100644
index 000000000..576c0a49b
--- /dev/null
+++ b/tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs
@@ -0,0 +1,19 @@
+using System;
+using MediaBrowser.Controller.Extensions;
+using Xunit;
+
+namespace Jellyfin.Controller.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));
+ }
+ }
+}