-Added support for root object in JSONPath filters
This commit is contained in:
@@ -419,6 +419,16 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
Assert.AreEqual(QueryOperator.Exists, orExpression.Expressions[1].Operator);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FilterWithRoot()
|
||||
{
|
||||
JPath path = new JPath("[?($.name>=12.1)]");
|
||||
BooleanQueryExpression expressions = (BooleanQueryExpression)((QueryFilter)path.Filters[0]).Expression;
|
||||
Assert.AreEqual(2, expressions.Path.Count);
|
||||
Assert.IsInstanceOf(typeof(RootFilter), expressions.Path[0]);
|
||||
Assert.IsInstanceOf(typeof(FieldFilter), expressions.Path[1]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BadOr1()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user