mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-21 21:12:50 +01:00
Merge pull request #89 from awegg/master
Fix issue with spaces after comma and or filters
This commit is contained in:
commit
cada68a83b
@ -13,7 +13,7 @@ namespace Sieve.Models
|
||||
where TFilterTerm : IFilterTerm, new()
|
||||
where TSortTerm : ISortTerm, new()
|
||||
{
|
||||
private const string EscapedCommaPattern = @"(?<!($|[^\\])(\\\\)*?\\),";
|
||||
private const string EscapedCommaPattern = @"(?<!($|[^\\])(\\\\)*?\\),\s*";
|
||||
|
||||
[DataMember]
|
||||
public string Filters { get; set; }
|
||||
|
@ -370,6 +370,23 @@ namespace SieveUnitTests
|
||||
Assert.AreEqual(1, resultCount);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CombinedAndOrWithSpaceFilteringWorks()
|
||||
{
|
||||
var model = new SieveModel()
|
||||
{
|
||||
Filters = "Title==D, (Title|LikeCount)==3",
|
||||
};
|
||||
|
||||
var result = _processor.Apply(model, _posts);
|
||||
var entry = result.FirstOrDefault();
|
||||
var resultCount = result.Count();
|
||||
|
||||
Assert.IsNotNull(entry);
|
||||
Assert.AreEqual(1, resultCount);
|
||||
Assert.AreEqual(3, entry.Id);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void OrValueFilteringWorks()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user