diff options
author | Paul Phillips <paulp@improving.org> | 2010-07-02 06:26:29 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-07-02 06:26:29 +0000 |
commit | 328651c39a3d35a2aaa0e09e7bb7a59bfddf90b3 (patch) | |
tree | ef82880842ec50fbcbd088b0cfad924f11b05c6c /src | |
parent | fbc453397552983a2c2a229cca8f7c13a641b9c7 (diff) | |
download | scala-328651c39a3d35a2aaa0e09e7bb7a59bfddf90b3.tar.gz scala-328651c39a3d35a2aaa0e09e7bb7a59bfddf90b3.tar.bz2 scala-328651c39a3d35a2aaa0e09e7bb7a59bfddf90b3.zip |
Made a null output sink and applied it to the r...
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() } +} |