summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-11-30 19:24:14 +0000
committerPaul Phillips <paulp@improving.org>2009-11-30 19:24:14 +0000
commit9fe1f1503ffb3f4c83cbf61459e7021e1780907e (patch)
treefc652d574b03e47d55076ee78432fe0cc638bbcf /test
parent4559f45c7ede9f11c1108dc14df1676ce181d32c (diff)
downloadscala-9fe1f1503ffb3f4c83cbf61459e7021e1780907e.tar.gz
scala-9fe1f1503ffb3f4c83cbf61459e7021e1780907e.tar.bz2
scala-9fe1f1503ffb3f4c83cbf61459e7021e1780907e.zip
Fix and test case for #2721.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/bug2721.check2
-rw-r--r--test/files/run/bug2721.scala12
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/bug2721.check b/test/files/run/bug2721.check
new file mode 100644
index 0000000000..2bd7656b36
--- /dev/null
+++ b/test/files/run/bug2721.check
@@ -0,0 +1,2 @@
+root:-rootVal-sub:-subVal-
+root:-rootVal-sub:-subVal-
diff --git a/test/files/run/bug2721.scala b/test/files/run/bug2721.scala
new file mode 100644
index 0000000000..8bd03bc838
--- /dev/null
+++ b/test/files/run/bug2721.scala
@@ -0,0 +1,12 @@
+object Test
+{
+ val xml1 = <root xmlns:ns="nsUri" ns:at="rootVal"><sub ns:at="subVal"/></root>
+ val xml2= scala.xml.XML.loadString("""<root xmlns:ns="nsUri" ns:at="rootVal"><sub ns:at="subVal"/></root>""")
+
+ def backslashSearch(x: xml.Elem) = "root:-"+(x \ "@{nsUri}at") +"-sub:-"+(x \ "sub" \ "@{nsUri}at") +"-"
+
+ def main(args: Array[String]): Unit = {
+ println(backslashSearch(xml1))
+ println(backslashSearch(xml2))
+ }
+}