-Added JsonLoadSettings
-Added CommentsHandling -Changed LINQ to JSON load to ignore array comments by default
This commit is contained in:
@@ -544,5 +544,21 @@ Parameter name: index");
|
||||
l = decks.ToList();
|
||||
Assert.AreEqual(1, l.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Parse_NoComments()
|
||||
{
|
||||
string json = "[1,2/*comment*/,3]";
|
||||
|
||||
JArray a = JArray.Parse(json, new JsonLoadSettings
|
||||
{
|
||||
CommentHandling = CommentHandling.Ignore
|
||||
});
|
||||
|
||||
Assert.AreEqual(3, a.Count);
|
||||
Assert.AreEqual(1, (int)a[0]);
|
||||
Assert.AreEqual(2, (int)a[1]);
|
||||
Assert.AreEqual(3, (int)a[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user