mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
Add test for ReadOnlySpan.Count extension
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user