-Fixed property after empty array JSONPath queries
-Fixed error handling when last value in array or object fails
This commit is contained in:
@@ -50,6 +50,22 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
[TestFixture]
|
||||
public class JPathExecuteTests : TestFixtureBase
|
||||
{
|
||||
[Test]
|
||||
public void SelectTokenAfterEmptyContainer()
|
||||
{
|
||||
string json = @"{
|
||||
'cont': [],
|
||||
'test': 'no one will find me'
|
||||
}";
|
||||
|
||||
JObject o = JObject.Parse(json);
|
||||
|
||||
IList<JToken> results = o.SelectTokens("$..test").ToList();
|
||||
|
||||
Assert.AreEqual(1, results.Count);
|
||||
Assert.AreEqual("no one will find me", (string)results[0]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EvaluatePropertyWithRequired()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user