Skip to content

Commit 78832dc

Browse files
som-snyttadriaanm
authored andcommitted
SI-7003 Partest redirects stderr to log file
Some scalac output is on stderr, and it's useful to see that in the log file, especially for debugging. Adds a line filter for logs, specified as "filter: pattern" in the test source. Backslashes are made forward only when detected as paths. Test alignments: Deprecations which do not pertain to the system under test are corrected in the obvious way. When testing deprecated API, suppress warnings by deprecating the Test object. Check files are updated with useful true warnings, instead of running under -nowarn. Language feature imports as required, instead of running under -language. Language feature not required, such as casual use of postfix. Heed useful warning. Ignore broken warnings. (Rarely, -nowarn.) Inliner warnings pop up under -optimise only, so for now, just filter them out where they occur. Debug output from the test required an update.
1 parent b29be0f commit 78832dc

File tree

10 files changed

+21
-14
lines changed

10 files changed

+21
-14
lines changed

test/files/jvm/t560bis.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import scala.xml._;
66
case _ => Console.println("bah")
77
}
88
def foo(args: List[String]) =
9-
Elem(null,"bla",Null, TopScope, (args map {x => Text(x)}):_*) match {
9+
Elem(null,"bla",Null, TopScope, minimizeEmpty = true, (args map {x => Text(x)}):_*) match {
1010
case Elem(_,_,_,_,Text("1"),_*) =>
1111
Console.println("cool!")
1212
case _ =>

test/files/jvm/xml01.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import org.xml.sax.InputSource
44
import scala.xml._
55

66
object Test extends App {
7+
def Elem(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding, child: Node*): Elem =
8+
scala.xml.Elem.apply(prefix, label, attributes, scope, minimizeEmpty = true, child: _*)
79
val e: scala.xml.MetaData = Null //Node.NoAttributes
810
val sc: scala.xml.NamespaceBinding = TopScope
911

test/files/jvm/xml03syntax.check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ true
2424

2525
node=<elem key="<b>hello</b>"/>, key=Some(<b>hello</b>)
2626
node=<elem/>, key=None
27+
<a>Š</a>

test/files/jvm/xml03syntax.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ object Test {
9191
}
9292
val parsed = parser.element(TopScope) // parse the source as element
9393
// alternatively, we could call document()
94-
parsed
94+
println(parsed)
9595
}
9696

9797
}

test/files/run/io-position.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
object Test {
2-
Console.setErr(Console.out)
3-
4-
def main(args: Array[String]): Unit = {
2+
def main(args: Array[String]): Unit = Console.withErr(Console.out) {
53
try {
64
xml.parsing.ConstructingParser.fromSource(io.Source.fromString("<foo>"), false).document()
75
} catch {

test/files/run/repl-backticks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Test {
88
`yield`
99
</code>.text
1010

11-
def main(args: Array[String]) = {
11+
def main(args: Array[String]) {
1212
val settings = new Settings()
1313
settings.classpath.value = System.getProperty("java.class.path")
1414
val repl = new interpreter.IMain(settings)

test/files/run/t1500.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object Test {
1616

1717
</code>.text
1818

19-
def main(args: Array[String]) = {
19+
def main(args: Array[String]) {
2020

2121
val settings = new Settings()
2222
settings.classpath.value = System.getProperty("java.class.path")

test/files/run/t1501.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object Test {
2727

2828
</code>.text
2929

30-
def main(args: Array[String]) = {
30+
def main(args: Array[String]) {
3131
val settings = new Settings()
3232
settings.classpath.value = System.getProperty("java.class.path")
3333
val tool = new interpreter.IMain(settings)

test/files/run/t3705.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
import scala.xml._
44
object Test {
5+
// guard caused verifyerror in oldpatmat
56
def updateNodes(ns: Seq[Node]): Seq[Node] =
67
for(subnode <- ns) yield subnode match {
78
case <d>{_}</d> if true => <d>abc</d>
89
case Elem(prefix, label, attribs, scope, children @ _*) =>
9-
Elem(prefix, label, attribs, scope, updateNodes(children) : _*)
10+
Elem(prefix, label, attribs, scope, minimizeEmpty = true, updateNodes(children) : _*)
1011
case other => other
1112
}
1213
def main(args: Array[String]): Unit = {
1314
updateNodes(<b />)
14-
1515
}
1616
}
1717

test/files/run/xml-loop-bug.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import java.io.{ Console => _, _ }
2+
import scala.io._
3+
import scala.xml.parsing._
14
object Test {
25
def main(args: Array[String]): Unit = {
3-
val sink = new java.io.PrintStream(new java.io.ByteArrayOutputStream())
4-
Console setOut sink
5-
Console setErr sink
6-
scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString("<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "), true).document.docElem
6+
val xml = "<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "
7+
val sink = new PrintStream(new ByteArrayOutputStream())
8+
(Console withOut sink) {
9+
(Console withErr sink) {
10+
ConstructingParser.fromSource((Source fromString xml), true).document.docElem
11+
}
12+
}
713
}
814
}

0 commit comments

Comments
 (0)