Skip to content

Commit 8bcdcc7

Browse files
i10416WojciechMazur
authored andcommitted
tidy: use run test instead of compile test
To check parsing properly, it is better to run a test and assert parse result. [Cherry-picked 9de9d57]
1 parent 42941b0 commit 8bcdcc7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Diff for: tests/pos/i16458.scala renamed to tests/run/i16458.scala

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
def x = <div>FooBar</div><!-- /.modal-content -->
1+
2+
object Test {
3+
import scala.xml.*
4+
def main(args: Array[String]): Unit = {
5+
val xml = <div>FooBar</div><!-- /.modal-content -->
6+
assert(
7+
xml match
8+
case Seq(elm: Elem, comment: Comment) if
9+
elm.label == "div" &&
10+
elm.child(0) == Atom(Text("FooBar")) &&
11+
comment.label == " /.modal-content "
12+
=> true
13+
case _ => false
14+
,
15+
xml
16+
)
17+
}
18+
}
219

320
package scala.xml {
421
type MetaData = AnyRef
@@ -16,7 +33,7 @@ package scala.xml {
1633
def child = Nil
1734
}
1835
class Elem(prefix: String, val label: String, attributes1: MetaData, scope: NamespaceBinding, minimizeEmpty: Boolean, val child: Node*) extends Node
19-
class NodeBuffer extends Seq[Node] {
36+
class NodeBuffer extends Seq[Node] {
2037
val nodes = scala.collection.mutable.ArrayBuffer.empty[Node]
2138
def &+(o: Any): NodeBuffer =
2239
o match {

0 commit comments

Comments
 (0)