We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcb83f3 commit e723935Copy full SHA for e723935
shared/src/test/scala/scala/xml/NodeSeqTest.scala
@@ -0,0 +1,23 @@
1
+package scala.xml
2
+
3
+import scala.xml.NodeSeq.seqToNodeSeq
4
5
+import org.junit.Test
6
+import org.junit.Assert.assertEquals
7
+import org.junit.Assert.fail
8
9
+class NodeSeqTest {
10
11
+ @Test
12
+ def testAppend: Unit = { // Bug #392.
13
+ val a: NodeSeq = <a>Hello</a>
14
+ val b = <b>Hi</b>
15
+ a ++ <b>Hi</b> match {
16
+ case res: NodeSeq => assertEquals(2, res.size)
17
+ case res: Seq[Node] => fail("Should be NodeSeq") // Unreachable code?
18
+ }
19
+ val res: NodeSeq = a ++ b
20
+ val exp = NodeSeq.fromSeq(Seq(<a>Hello</a>, <b>Hi</b>))
21
+ assertEquals(exp, res)
22
23
+}
0 commit comments