-Fixed potential inifinite loop when parsing unquoted value

-Added NuGet install.ps1
-Incremented version to 5.0.6
This commit is contained in:
James Newton-King
2013-06-01 14:18:20 +12:00
parent 1b63698c02
commit 13aa07f63e
9 changed files with 144 additions and 9 deletions
@@ -47,6 +47,32 @@ namespace Newtonsoft.Json.Tests
[TestFixture]
public class JsonTextReaderTest : TestFixtureBase
{
[Test]
public void ThrowErrorWhenParsingUnquoteStringThatStartsWithNE()
{
const string json = @"{ ""ItemName"": ""value"", ""u"":netanelsalinger,""r"":9 }";
JsonTextReader reader = new JsonTextReader(new StringReader(json));
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.StartObject, reader.TokenType);
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.PropertyName, reader.TokenType);
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.String, reader.TokenType);
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.PropertyName, reader.TokenType);
ExceptionAssert.Throws<JsonReaderException>("Unexpected content while parsing JSON. Path 'u', line 1, position 27.",
() =>
{
reader.Read();
});
}
[Test]
public void FloatParseHandling()
{
@@ -49,6 +49,17 @@ namespace Newtonsoft.Json.Tests.Linq
[TestFixture]
public class LinqToJsonTest : TestFixtureBase
{
[Test]
public void ForEach()
{
JArray items = new JArray(new JObject(new JProperty("name", "value!")));
foreach (JObject friend in items)
{
Console.WriteLine(friend);
}
}
[Test]
public void DoubleValue()
{
@@ -75,4 +75,4 @@ using System.Security;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
[assembly: AssemblyFileVersion("5.0.5.16124")]
[assembly: AssemblyFileVersion("5.0.6.16201")]