-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:
James Newton-King
2014-10-18 15:36:42 +13:00
parent 01f1c5e261
commit 88a29704da
12 changed files with 385 additions and 287 deletions
@@ -3151,6 +3151,32 @@ null//comment
Assert.IsTrue(reader.Read());
}
[Test]
public void EscapedPathInExceptionMessage()
{
string json = @"{
""frameworks"": {
""aspnetcore50"": {
""dependencies"": {
""System.Xml.ReaderWriter"": {
""source"": !!! !!!
}
}
}
}
}";
ExceptionAssert.Throws<JsonReaderException>(
() =>
{
JsonTextReader reader = new JsonTextReader(new StringReader(json));
while (reader.Read())
{
}
},
"Unexpected character encountered while parsing value: !. Path 'frameworks.aspnetcore50.dependencies.['System.Xml.ReaderWriter'].source', line 6, position 21.");
}
}
public class ToggleReaderError : TextReader