diff --git a/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs b/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs
index 5937a700..619636b4 100644
--- a/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs
+++ b/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs
@@ -141,6 +141,24 @@ namespace Newtonsoft.Json.Tests.Converters
json = JsonConvert.SerializeXNode(doc1, Formatting.Indented, true);
Assert.AreEqual("null", json);
}
+
+ [Test]
+ public void SerializeAndDeserializeXmlWithNamespaceInChildrenAndNoValueInChildren()
+ {
+ var xmlString = @"
+
+ AAA
+ adad
+ ";
+
+ var xml = XElement.Parse(xmlString);
+
+ var json1 = JsonConvert.SerializeXNode(xml);
+ var xmlBack = JsonConvert.DeserializeObject(json1);
+
+ var equals = XElement.DeepEquals(xmlBack, xml);
+ Assert.IsTrue(equals);
+ }
#endif
[Test]
diff --git a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs
index 7f07085b..81952314 100644
--- a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs
@@ -50,6 +50,16 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
[TestFixture]
public class JPathExecuteTests : TestFixtureBase
{
+ [Test]
+ public void EvaluateEmptyPropertyIndexer()
+ {
+ JObject o = new JObject(
+ new JProperty("", 1));
+
+ JToken t = o.SelectToken("['']");
+ Assert.AreEqual(1, (int)t);
+ }
+
[Test]
public void EvaluateEmptyString()
{
@@ -58,6 +68,19 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
JToken t = o.SelectToken("");
Assert.AreEqual(o, t);
+
+ t = o.SelectToken("['']");
+ Assert.AreEqual(null, t);
+ }
+
+ [Test]
+ public void EvaluateEmptyStringWithMatchingEmptyProperty()
+ {
+ JObject o = new JObject(
+ new JProperty(" ", 1));
+
+ JToken t = o.SelectToken("[' ']");
+ Assert.AreEqual(1, (int)t);
}
[Test]
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj
index 313dc6e9..05633c52 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj
@@ -140,6 +140,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj
index e137e0fd..d7fa9a92 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj
@@ -66,6 +66,10 @@
AllRules.ruleset
+
+ False
+ ..\packages\FSharp.Core.4.0.0\lib\FSharp.Core.dll
+
False
@@ -258,6 +262,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj
index 42f7caa6..73528136 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj
@@ -67,6 +67,10 @@
false
+
+ False
+ ..\packages\FSharp.Core.4.0.0\lib\FSharp.Core.dll
+
..\packages\NUnit.2.6.2\lib\nunit.framework.dll
@@ -142,6 +146,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj
index 9ac4fd92..e3293651 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj
@@ -67,6 +67,10 @@
false
+
+ False
+ ..\packages\FSharp.Core.4.0.0\lib\FSharp.Core.dll
+
False
@@ -138,6 +142,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
index 02e75a34..fee4e78f 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
@@ -30,6 +30,10 @@
4
+
+ False
+ ..\packages\FSharp.Core.4.0.0\lib\FSharp.Core.dll
+
False
..\packages\NUnit.2.6.2\lib\nunit.framework.dll
@@ -233,6 +237,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
index 380b1a6f..2327e9ff 100644
--- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
+++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
@@ -75,4 +75,4 @@ using System.Security;
// by using the '*' as shown below:
[assembly: AssemblyVersion("6.0.0.0")]
-[assembly: AssemblyFileVersion("6.0.1.17101")]
+[assembly: AssemblyFileVersion("6.0.1.17109")]
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/FSharpTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/FSharpTests.cs
new file mode 100644
index 00000000..1ac1fe20
--- /dev/null
+++ b/Src/Newtonsoft.Json.Tests/Serialization/FSharpTests.cs
@@ -0,0 +1,94 @@
+#region License
+// Copyright (c) 2007 James Newton-King
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+#endregion
+
+#if !(NET35 || NET20 || NETFX_CORE)
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.FSharp.Collections;
+using NUnit.Framework;
+
+namespace Newtonsoft.Json.Tests.Serialization
+{
+ [TestFixture]
+ public class FSharpTests : TestFixtureBase
+ {
+ [Test]
+ public void List()
+ {
+ FSharpList l = ListModule.OfSeq(new List {1,2,3});
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+
+ Assert.AreEqual(@"[
+ 1,
+ 2,
+ 3
+]", json);
+
+ FSharpList l2 = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(l.Length, l2.Length);
+ CollectionAssert.AreEquivalent(l, l2);
+ }
+
+ [Test]
+ public void Set()
+ {
+ FSharpSet l = SetModule.OfSeq(new List { 1, 2, 3 });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+
+ Assert.AreEqual(@"[
+ 1,
+ 2,
+ 3
+]", json);
+
+ FSharpSet l2 = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(l.Count, l2.Count);
+ CollectionAssert.AreEquivalent(l, l2);
+ }
+
+ [Test]
+ public void Map()
+ {
+ FSharpMap m1 = MapModule.OfSeq(new List> { Tuple.Create("one", 1), Tuple.Create("II", 2), Tuple.Create("3", 3) });
+
+ string json = JsonConvert.SerializeObject(m1, Formatting.Indented);
+
+ FSharpMap m2 = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(m1.Count, m2.Count);
+ Assert.AreEqual(1, m2["one"]);
+ Assert.AreEqual(2, m2["II"]);
+ Assert.AreEqual(3, m2["3"]);
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/packages.config b/Src/Newtonsoft.Json.Tests/packages.config
index 1e7b38fd..3f4320f3 100644
--- a/Src/Newtonsoft.Json.Tests/packages.config
+++ b/Src/Newtonsoft.Json.Tests/packages.config
@@ -1,5 +1,6 @@
+
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs b/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs
index 11b68fa8..979fc38e 100644
--- a/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs
+++ b/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs
@@ -23,6 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
+#if !(NET35 || NET20 || NETFX_CORE)
using System;
using System.Collections;
using System.Collections.Generic;
@@ -44,16 +45,6 @@ namespace Newtonsoft.Json.Converters
///
public class DiscriminatedUnionConverter : JsonConverter
{
- private static bool _initialized;
- private static MethodCall