-Fixed JToken.ReadFrom creating a string value for a comment
This commit is contained in:
@@ -57,6 +57,23 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
[TestFixture]
|
||||
public class JObjectTests : TestFixtureBase
|
||||
{
|
||||
[Test]
|
||||
public void EmbedJValueStringInNewJObject()
|
||||
{
|
||||
string s = null;
|
||||
var v = new JValue(s);
|
||||
dynamic o = JObject.FromObject(new { title = v });
|
||||
|
||||
string output = o.ToString();
|
||||
|
||||
Assert.AreEqual(@"{
|
||||
""title"": null
|
||||
}", output);
|
||||
|
||||
Assert.AreEqual(null, v.Value);
|
||||
Assert.IsNull((string)o.title);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void JObjectWithComments()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user