-Fixed jsonpath error when parsing a property that follows an escaped property
-Changed reader/writer/token path to escape property names containing special characters
This commit is contained in:
@@ -643,5 +643,18 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
{
|
||||
ExceptionAssert.Throws<JsonException>(() => { new JPath("[1]Blah"); }, "Unexpected character following indexer: B");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PropertyFollowingEscapedPropertyName()
|
||||
{
|
||||
JPath path = new JPath("frameworks.aspnetcore50.dependencies.['System.Xml.ReaderWriter'].source");
|
||||
Assert.AreEqual(5, path.Filters.Count);
|
||||
|
||||
Assert.AreEqual("frameworks", ((FieldFilter)path.Filters[0]).Name);
|
||||
Assert.AreEqual("aspnetcore50", ((FieldFilter)path.Filters[1]).Name);
|
||||
Assert.AreEqual("dependencies", ((FieldFilter)path.Filters[2]).Name);
|
||||
Assert.AreEqual("System.Xml.ReaderWriter", ((FieldFilter)path.Filters[3]).Name);
|
||||
Assert.AreEqual("source", ((FieldFilter)path.Filters[4]).Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user