Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2015-01-30 13:12:42 +0300
committerAtsushi Eno <atsushieno@gmail.com>2015-03-02 06:36:40 +0300
commit77c316c520085e974c4e4f6606dcf132cc5e0afa (patch)
treec216529c89497c02f1b8df33068e34d6c75cccc9 /mcs/class/System.Xml.Linq
parent848916fb2b40de75ed4f55e714811812b4dbab83 (diff)
[XLinq] fix some "regressions" caused by referencesource switch.
EOLs are platform dependent on referencesource. Turn NotDotNet into Ignore (as we're also importing buggy implementation).
Diffstat (limited to 'mcs/class/System.Xml.Linq')
-rw-r--r--mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs8
-rw-r--r--mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeWriterTest.cs4
-rw-r--r--mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs7
3 files changed, 10 insertions, 9 deletions
diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs
index 70616aa0da0..61c77d3ecc9 100644
--- a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs
+++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs
@@ -805,7 +805,7 @@ namespace MonoTests.System.Xml.Linq
{
XElement a = new XElement ("a", "7");
XElement b = new XElement ("b", new XCData (" 42 "));
- XElement c = new XElement ("c", " \r\n 13 \t ");
+ XElement c = new XElement ("c", " \r\n 13 \t ".Replace ("\r\n", Environment.NewLine));
XElement d = new XElement ("d", -101);
XElement o = new XElement ("o", "0");
XElement l = new XElement ("l", "1");
@@ -818,13 +818,13 @@ namespace MonoTests.System.Xml.Linq
// Verify expected "cloning" and basic conversion behaviour as prerequisites
Assert.IsFalse (a.IsEmpty, "#1-1");
Assert.IsFalse (new XElement (b).IsEmpty, "#1-2");
- Assert.AreEqual (" \r\n 13 \t ", c.Value, "#2-1");
+ Assert.AreEqual (" \r\n 13 \t ".Replace ("\r\n", Environment.NewLine), c.Value, "#2-1");
Assert.AreEqual ("-101", new XElement (d).Value, "#2-2");
Assert.AreNotSame (o, new XElement (o), "#3-1");
Assert.AreEqual (l.ToString (), new XElement (l).ToString (), "#3-2");
Assert.AreEqual ("<a>7</a>", a.ToString (), "#3-3a");
Assert.AreEqual ("<b><![CDATA[ 42 ]]></b>", b.ToString (), "#3-3b");
- Assert.AreEqual ("<c> \r\n 13 \t </c>", c.ToString (), "#3-3c");
+ Assert.AreEqual ("<c> \r\n 13 \t </c>".Replace ("\r\n", Environment.NewLine), c.ToString (), "#3-3c");
Assert.AreEqual ("<d>-101</d>", d.ToString (), "#3-3d");
Assert.AreEqual ("<o>0</o>", new XElement ("o", 0.0).ToString (), "#3-3o");
Assert.AreEqual ("<l>1</l>", new XElement ("l", 1.0f).ToString (), "#3-3l");
@@ -1023,7 +1023,7 @@ namespace MonoTests.System.Xml.Linq
AssertThrows<FormatException> (() => { TimeSpan? z = (TimeSpan?) new XElement (n); }, "n:TimeSpan?");
Assert.AreEqual ("7", (string) new XElement (a), "a:string");
Assert.AreEqual (" 42 ", (string) new XElement (b), "b:string");
- Assert.AreEqual (" \r\n 13 \t ", (string) new XElement (c), "c:string");
+ Assert.AreEqual (" \r\n 13 \t ".Replace ("\r\n", Environment.NewLine), (string) new XElement (c), "c:string");
Assert.AreEqual ("-101", (string) new XElement (d), "d:string");
Assert.AreEqual ("0", (string) new XElement (o), "o:string");
Assert.AreEqual ("1", (string) new XElement (l), "l:string");
diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeWriterTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeWriterTest.cs
index 39e52c0a73f..eadc1dc5c0c 100644
--- a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeWriterTest.cs
+++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeWriterTest.cs
@@ -131,11 +131,11 @@ namespace MonoTests.System.Xml.Linq
}
var sb = new StringBuilder ();
- sb.Append ("<MyRoot xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"urn:mynamespace\">\r\n");
+ sb.Append ("<MyRoot xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"urn:mynamespace\">\r\n");
sb.Append (" <Elements xsi:type=\"MyElement1\" V=\"2\" />\r\n");
sb.Append ("</MyRoot>");
- Assert.AreEqual (sb.ToString (), doc.Root.ToString ());
+ Assert.AreEqual (sb.ToString ().Replace ("\r\n", Environment.NewLine), doc.Root.ToString ());
}
}
}
diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs
index 72adeb74056..faab113f6d0 100644
--- a/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs
+++ b/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs
@@ -580,16 +580,17 @@ namespace MonoTests.System.Xml
XPathNavigator nav = doc.CreateNavigator ();
XPathNodeIterator iter = nav.Select ("/Abc/Foo");
iter.MoveNext ();
- Assert.AreEqual ("Hello&lt;\r\nInnerXml", iter.Current.InnerXml, "#1");
- Assert.AreEqual ("<Foo>Hello&lt;\r\nInnerXml</Foo>", iter.Current.OuterXml, "#2");
+ Assert.AreEqual ("Hello&lt;\r\nInnerXml".Replace ("\r\n", Environment.NewLine), iter.Current.InnerXml, "#1");
+ Assert.AreEqual ("<Foo>Hello&lt;\r\nInnerXml</Foo>".Replace ("\r\n", Environment.NewLine), iter.Current.OuterXml, "#2");
iter = nav.Select ("/Abc/Foo/text()");
iter.MoveNext ();
Assert.AreEqual (String.Empty, iter.Current.InnerXml, "#3");
- Assert.AreEqual ("Hello&lt;\r\nInnerXml", iter.Current.OuterXml, "#4");
+ Assert.AreEqual ("Hello&lt;\r\nInnerXml".Replace ("\r\n", Environment.NewLine), iter.Current.OuterXml, "#4");
}
[Test]
[Category ("NotDotNet")] // .NET bug; it should escape value
+ [Ignore ("referencesource System.Xml bug")]
public void InnerXmlAttributeEscape ()
{
StringReader sr = new StringReader ("<Abc><Foo attr='val&quot;1&#13;&#10;&gt;'/></Abc>");