diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-09-03 12:12:00 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-09-03 12:12:00 +0000 |
commit | b6afe3dc0c983435b49c014a206e3fd2b2334d17 (patch) | |
tree | 852b4701023567c937546496fc24ed756c8f2461 /src | |
parent | 95fa7114881187ca083161e08948930929a20dc7 (diff) | |
download | scala-b6afe3dc0c983435b49c014a206e3fd2b2334d17.tar.gz scala-b6afe3dc0c983435b49c014a206e3fd2b2334d17.tar.bz2 scala-b6afe3dc0c983435b49c014a206e3fd2b2334d17.zip |
Merged revisions 22472 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r22472 | extempore | 2010-07-02 08:26:29 +0200 (Fri, 02 Jul 2010) | 3 lines
Made a null output sink and applied it to the recently failing test,
which is displaying non-deterministic output by way of the underlying
parser. No review. ........
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/io/NullPrintStream.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/io/NullPrintStream.scala b/src/compiler/scala/tools/nsc/io/NullPrintStream.scala new file mode 100644 index 0000000000..9340796a83 --- /dev/null +++ b/src/compiler/scala/tools/nsc/io/NullPrintStream.scala @@ -0,0 +1,19 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2010 LAMP/EPFL + * @author Paul Phillips + */ + +package scala.tools.nsc +package io + +import java.io.{ PrintStream, ByteArrayOutputStream } + +/** A sink for when you want to discard all output. + */ +class NullPrintStream extends PrintStream(new ByteArrayOutputStream()) { } + +object NullPrintStream extends NullPrintStream { + def setOut() = Console setOut this + def setErr() = Console setErr this + def setOutAndErr() = { setOut() ; setErr() } +} |