-Changed LINQ to JSON load methods to support reading past preceding comments

This commit is contained in:
James Newton-King
2012-07-16 00:01:40 +12:00
parent 55a09d2f73
commit 5d83daa804
8 changed files with 38 additions and 3 deletions
@@ -803,6 +803,7 @@ keyword such as type of business.""
o.Children()["item"].Children()["title"].Values<string>().ToArray());
}
[Test]
public void UriGuidTimeSpanTestClassEmptyTest()
{
UriGuidTimeSpanTestClass c1 = new UriGuidTimeSpanTestClass();
@@ -824,6 +825,7 @@ keyword such as type of business.""
Assert.AreEqual(c1.Uri, c2.Uri);
}
[Test]
public void UriGuidTimeSpanTestClassValuesTest()
{
UriGuidTimeSpanTestClass c1 = new UriGuidTimeSpanTestClass
@@ -851,5 +853,17 @@ keyword such as type of business.""
Assert.AreEqual(c1.NullableTimeSpan, c2.NullableTimeSpan);
Assert.AreEqual(c1.Uri, c2.Uri);
}
[Test]
public void ParseWithPrecendingComments()
{
string json = @"/* blah */ {'hi':'hi!'}";
JObject o = JObject.Parse(json);
Assert.AreEqual("hi!", (string)o["hi"]);
json = @"/* blah */ ['hi!']";
JArray a = JArray.Parse(json);
Assert.AreEqual("hi!", (string)a[0]);
}
}
}
@@ -72,5 +72,5 @@ using System.Security;
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
#if !PocketPC
[assembly: AssemblyFileVersion("4.5.7.15114")]
[assembly: AssemblyFileVersion("4.5.7.15115")]
#endif