You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
488 B
19 lines
488 B
3 years ago
|
using System;
|
||
|
using Xunit;
|
||
|
|
||
3 years ago
|
namespace Jellyfin.Extensions.Tests
|
||
3 years ago
|
{
|
||
|
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));
|
||
|
}
|
||
|
}
|
||
|
}
|