diff options
author | Paul Phillips <paulp@improving.org> | 2009-11-30 19:24:14 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-11-30 19:24:14 +0000 |
commit | 9fe1f1503ffb3f4c83cbf61459e7021e1780907e (patch) | |
tree | fc652d574b03e47d55076ee78432fe0cc638bbcf /test/files/run | |
parent | 4559f45c7ede9f11c1108dc14df1676ce181d32c (diff) | |
download | scala-9fe1f1503ffb3f4c83cbf61459e7021e1780907e.tar.gz scala-9fe1f1503ffb3f4c83cbf61459e7021e1780907e.tar.bz2 scala-9fe1f1503ffb3f4c83cbf61459e7021e1780907e.zip |
Fix and test case for #2721.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bug2721.check | 2 | ||||
-rw-r--r-- | test/files/run/bug2721.scala | 12 |
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)) + } +} |