diff options
Diffstat (limited to 'test/files/run/xml-loop-bug.scala')
-rw-r--r-- | test/files/run/xml-loop-bug.scala | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/files/run/xml-loop-bug.scala b/test/files/run/xml-loop-bug.scala index 67637674b2..dc155dbb02 100644 --- a/test/files/run/xml-loop-bug.scala +++ b/test/files/run/xml-loop-bug.scala @@ -1,8 +1,14 @@ +import java.io.{ Console => _, _ } +import scala.io._ +import scala.xml.parsing._ object Test { def main(args: Array[String]): Unit = { - val sink = new java.io.PrintStream(new java.io.ByteArrayOutputStream()) - Console setOut sink - Console setErr sink - scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString("<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "), true).document.docElem + val xml = "<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> " + val sink = new PrintStream(new ByteArrayOutputStream()) + (Console withOut sink) { + (Console withErr sink) { + ConstructingParser.fromSource((Source fromString xml), true).document.docElem + } + } } } |