mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
31 lines
967 B
C#
31 lines
967 B
C#
using Xunit;
|
|
|
|
namespace Jellyfin.Server.Implementations.Tests.Library;
|
|
|
|
public class DotIgnoreIgnoreRuleTest
|
|
{
|
|
[Fact]
|
|
public void Test()
|
|
{
|
|
var ignore = new Ignore.Ignore();
|
|
ignore.Add("SPs");
|
|
Assert.True(ignore.IsIgnored("f:/cd/sps/ffffff.mkv"));
|
|
Assert.True(ignore.IsIgnored("cd/sps/ffffff.mkv"));
|
|
Assert.True(ignore.IsIgnored("/cd/sps/ffffff.mkv"));
|
|
}
|
|
|
|
[Fact]
|
|
public void TestNegatePattern()
|
|
{
|
|
var ignore = new Ignore.Ignore();
|
|
ignore.Add("SPs");
|
|
ignore.Add("!thebestshot.mkv");
|
|
Assert.True(ignore.IsIgnored("f:/cd/sps/ffffff.mkv"));
|
|
Assert.True(ignore.IsIgnored("cd/sps/ffffff.mkv"));
|
|
Assert.True(ignore.IsIgnored("/cd/sps/ffffff.mkv"));
|
|
Assert.True(!ignore.IsIgnored("f:/cd/sps/thebestshot.mkv"));
|
|
Assert.True(!ignore.IsIgnored("cd/sps/thebestshot.mkv"));
|
|
Assert.True(!ignore.IsIgnored("/cd/sps/thebestshot.mkv"));
|
|
}
|
|
}
|