Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -36,6 +36,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
}
[Test]
[Category ("MobileNotWorking")]
public void MSXslNodeSetAcceptsNodeSet ()
{
string xsl = @"<xsl:stylesheet version='1.0'
@@ -57,6 +58,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
}
[Test]
[Category ("MobileNotWorking")]
public void MSXslNodeSetAcceptsEmptyString ()
{
string xsl = @"<xsl:stylesheet version='1.0'
@@ -135,11 +137,36 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
t.Load (new XmlTextReader (new StringReader (xsl)));
var source = "<?xml version='1.0' encoding='utf-8' ?><Node><Name>123</Name></Node>";
#if MOBILE
var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Node name=\"123\"></Node>";
#else
var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Node name=\"123\" />";
#endif
StringWriter sw = new StringWriter ();
t.Transform (new XPathDocument (new XmlTextReader (new StringReader (source))), null, sw);
var xp = new XPathDocument (new XmlTextReader (new StringReader (source)));
t.Transform (xp, null, sw);
Assert.AreEqual (expected, sw.ToString ());
}
[Test] // bug 2917
[Category ("MobileNotWorking")]
public void XslOutputSettings ()
{
XslCompiledTransform xslCompiledTransform = new XslCompiledTransform();
string xsl =
@"<?xml version=""1.0"" encoding=""UTF-8"" ?>
<xsl:stylesheet version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" xmlns:extensions=""urn:extensions"" exclude-result-prefixes=""extensions"">
<xsl:output method=""xml"" indent=""yes""/>
<xsl:template match="" / ""></xsl:template>
</xsl:stylesheet>";
var xmlReader = XmlReader.Create(new StringReader(xsl));
xslCompiledTransform.Load(xmlReader);
// Returns true on .NET and False on mono 2.10.2
Assert.IsTrue (xslCompiledTransform.OutputSettings.Indent, "#1");
}
}
}

View File

@@ -21,6 +21,8 @@ namespace MonoTests.System.Xml.Xsl
[TestFixture]
public class XslTransformTests
{
static readonly string end_of_line = "\r\n";
XmlDocument doc;
XslTransform xslt;
XmlDocument result;
@@ -150,11 +152,6 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
}
[Test]
[Category ("NotDotNet")]
// Actually MS.NET here throws XsltException, but Mono returns
// XPathException (since XPath evaluation engine generally
// catches (should catch) static error. It is implementation
// dependent matter.
[ExpectedException (typeof (XPathException))]
public void MSXslNodeSetRejectsNodeSet ()
{
@@ -415,7 +412,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
// http://support.microsoft.com/default.aspx?scid=kb;en-us;834667
[Test]
[Category ("NotDotNet")]
//[Category ("NotDotNet")]
public void LocalParameter ()
{
string xsltFragment = @"<?xml version=""1.0"" encoding=""UTF-8"" ?>
@@ -999,7 +996,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
" <something>{0}" +
" <else />{0}" +
" </something>{0}" +
"</test>", Environment.NewLine), sw.ToString (), "#1");
"</test>", end_of_line), sw.ToString (), "#1");
// set indent to no
sw.GetStringBuilder ().Length = 0;
@@ -1134,7 +1131,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
" <something>{0}" +
" <else />{0}" +
" </something>{0}" +
"</test>", Environment.NewLine), sw.ToString (), "#1");
"</test>", end_of_line), sw.ToString (), "#1");
// set indent to no
sw.GetStringBuilder ().Length = 0;
@@ -1585,7 +1582,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
"{1}<Body>{0}" +
"{1}{1}<BR>{0}" +
"{1}</Body>{0}" +
"</html>", Environment.NewLine, " "), sw.ToString (), "#1");
"</html>", end_of_line, " "), sw.ToString (), "#1");
// indent no, media-type not set
options = "indent=\"no\"";
@@ -1624,7 +1621,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
"{1}<Body>{0}" +
"{1}{1}<BR>{0}" +
"{1}</Body>{0}" +
"</html>", Environment.NewLine, " "), sw.ToString (), "#3");
"</html>", end_of_line, " "), sw.ToString (), "#3");
}
[Test]
@@ -1674,7 +1671,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
"{1}<Body>{0}" +
"{1}{1}<BR>{0}" +
"{1}</Body>{0}" +
"</html>", Environment.NewLine, " "), result, "#1");
"</html>", end_of_line, " "), result, "#1");
// indent no, media-type not set
options = "indent=\"no\"";
@@ -1721,7 +1718,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
"{1}<Body>{0}" +
"{1}{1}<BR>{0}" +
"{1}</Body>{0}" +
"</html>", Environment.NewLine, " "), result, "#3");
"</html>", end_of_line, " "), result, "#3");
}
[Test]
@@ -1808,7 +1805,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
" <tr>{0}" +
" <td>1,000</td>{0}" +
" </tr>{0}" +
"</table>", Environment.NewLine), sw.ToString ());
"</table>", end_of_line), sw.ToString ());
}
// http://support.microsoft.com/kb/293469/en-us
@@ -1845,7 +1842,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
"<?xml version=\"1.0\" encoding=\"utf-16\"?>{0}" +
"<html>{0}" +
" <body>44.442,70</body>{0}" +
"</html>", Environment.NewLine), sw.ToString ());
"</html>", end_of_line), sw.ToString ());
}
[Test]
@@ -2330,7 +2327,7 @@ NO
</l0>
</root>")), null, sw);
// Assert.AreEqual (@"<y><t yes-one-node="""">1</t><t not-node=""""></t></y>", sw.ToString ());
Assert.AreEqual ("\r\n \r\n <y><t yes-one-node=\"\">1</t><t not-node=\"\"></t></y>\r\n \r\n", sw.ToString ());
Assert.AreEqual ("\r\n \r\n <y><t yes-one-node=\"\">1</t><t not-node=\"\"></t></y>\r\n \r\n".Replace ("\r\n", Environment.NewLine), sw.ToString ());
}
[Test]
@@ -2364,6 +2361,7 @@ NO
}
[Test]
[Category ("NotWorking")] // FIXME: SRE related regression
public void Bug487065 ()
{
using (XmlReader input = GetInput ()) {

View File

@@ -36,7 +36,7 @@ using System.Security.Permissions;
using System.Security.Policy;
using System.Xml.Xsl;
namespace MonoCasTests.System.Xml.Xsl
namespace MonoTests.System.Xml.Xsl
{
[TestFixture]
public class XsltCompileExceptionTests {