mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Add .gitignore style ignoring (#13906)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user