X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.XML%2FTest%2FSystem.Xml.XPath%2FXPathNavigatorTests.cs;h=70527943fbea6e3214a87b7f5b9fdaa008ae5c61;hb=881f83658281916d8f0784df7c726ecb7cc289db;hp=19242a7fffa554da89fcd777df05a4ed7ce7ba08;hpb=e19092967f4ba5bd9a420479f539e4bfaefd53bc;p=mono.git
diff --git a/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs b/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs
index 19242a7fffa..70527943fbe 100644
--- a/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs
@@ -551,6 +551,47 @@ namespace MonoTests.System.Xml
AssertEquals ("#3", String.Empty, iter.Current.InnerXml);
AssertEquals ("#4", "Hello", iter.Current.OuterXml);
}
+
+ [Test] // bug #79875
+ public void InnerXmlAttribute ()
+ {
+ StringReader sr = new StringReader ("");
+ XPathDocument doc = new XPathDocument (sr);
+ XPathNavigator nav = doc.CreateNavigator ();
+
+ XPathNodeIterator iter = nav.Select ("/Abc/Foo/@attr");
+ iter.MoveNext ();
+ AssertEquals ("val1", iter.Current.InnerXml);
+ }
+
+ [Test]
+ public void InnerXmlTextEscape ()
+ {
+ StringReader sr = new StringReader ("Hello<\r\nInnerXml");
+ XPathDocument doc = new XPathDocument (sr);
+ XPathNavigator nav = doc.CreateNavigator ();
+ XPathNodeIterator iter = nav.Select ("/Abc/Foo");
+ iter.MoveNext ();
+ AssertEquals ("#1", "Hello<\r\nInnerXml", iter.Current.InnerXml);
+ AssertEquals ("#2", "Hello<\r\nInnerXml", iter.Current.OuterXml);
+ iter = nav.Select ("/Abc/Foo/text()");
+ iter.MoveNext ();
+ AssertEquals ("#3", String.Empty, iter.Current.InnerXml);
+ AssertEquals ("#4", "Hello<\r\nInnerXml", iter.Current.OuterXml);
+ }
+
+ [Test]
+ [Category ("NotDotNet")] // .NET bug; it should escape value
+ public void InnerXmlAttributeEscape ()
+ {
+ StringReader sr = new StringReader ("");
+ XPathDocument doc = new XPathDocument (sr);
+ XPathNavigator nav = doc.CreateNavigator ();
+
+ XPathNodeIterator iter = nav.Select ("/Abc/Foo/@attr");
+ iter.MoveNext ();
+ AssertEquals ("val"1
>", iter.Current.InnerXml);
+ }
#endif
}
}