summaryrefslogtreecommitdiff
path: root/test/files/run/t6939.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t6939.scala')
-rw-r--r--test/files/run/t6939.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/t6939.scala b/test/files/run/t6939.scala
new file mode 100644
index 0000000000..9fe721555f
--- /dev/null
+++ b/test/files/run/t6939.scala
@@ -0,0 +1,13 @@
+object Test extends App {
+ val foo = <x:foo xmlns:x="http://foo.com/"><x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>
+ assert(foo.child.head.scope.toString == """ xmlns:x="http://bar.com/"""")
+
+ val fooDefault = <foo xmlns="http://foo.com/"><bar xmlns="http://bar.com/"><baz/></bar></foo>
+ assert(fooDefault.child.head.scope.toString == """ xmlns="http://bar.com/"""")
+
+ val foo2 = scala.xml.XML.loadString("""<x:foo xmlns:x="http://foo.com/"><x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>""")
+ assert(foo2.child.head.scope.toString == """ xmlns:x="http://bar.com/"""")
+
+ val foo2Default = scala.xml.XML.loadString("""<foo xmlns="http://foo.com/"><bar xmlns="http://bar.com/"><baz/></bar></foo>""")
+ assert(foo2Default.child.head.scope.toString == """ xmlns="http://bar.com/"""")
+}