diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/xml03syntax.check | 2 | ||||
-rw-r--r-- | test/files/run/xml-attribute.scala | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/test/files/jvm/xml03syntax.check b/test/files/jvm/xml03syntax.check index 75dc539137..9fbedc2ae6 100644 --- a/test/files/jvm/xml03syntax.check +++ b/test/files/jvm/xml03syntax.check @@ -23,4 +23,4 @@ true 4 node=<elem key="<b>hello</b>"></elem>, key=Some(<b>hello</b>) -node=<elem ></elem>, key=None +node=<elem></elem>, key=None diff --git a/test/files/run/xml-attribute.scala b/test/files/run/xml-attribute.scala new file mode 100644 index 0000000000..2b83f70b22 --- /dev/null +++ b/test/files/run/xml-attribute.scala @@ -0,0 +1,14 @@ +import xml.Node + +object Test { + def main(args: Array[String]): Unit = { + val noAttr = <t/> + val attrNull = <t a={ null: String }/> + val attrNone = <t a={ None: Option[Seq[Node]] }/> + assert(noAttr == attrNull) + assert(noAttr == attrNone) + assert(noAttr.toString() == "<t></t>") + assert(attrNull.toString() == "<t></t>") + assert(attrNone.toString() == "<t></t>") + } +} |