Type Members
-
trait
UnsafeAPI extends AnyRef
Abstract Value Members
-
abstract
def
clearInput(implicit trace: Trace): UIO[Unit]
-
abstract
def
clearOutput(implicit trace: Trace): UIO[Unit]
-
abstract
def
clearOutputErr(implicit trace: Trace): UIO[Unit]
-
abstract
def
debug[R, E, A](zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
-
abstract
def
feedLines(lines: String*)(implicit trace: Trace): UIO[Unit]
-
abstract
def
output(implicit trace: Trace): UIO[Vector[String]]
-
abstract
def
outputErr(implicit trace: Trace): UIO[Vector[String]]
-
abstract
def
print(line: ⇒ Any)(implicit trace: Trace): IO[IOException, Unit]
-
abstract
def
printError(line: ⇒ Any)(implicit trace: Trace): IO[IOException, Unit]
-
abstract
def
printLine(line: ⇒ Any)(implicit trace: Trace): IO[IOException, Unit]
-
abstract
def
printLineError(line: ⇒ Any)(implicit trace: Trace): IO[IOException, Unit]
-
abstract
def
readLine(implicit trace: Trace): IO[IOException, String]
-
abstract
def
save(implicit trace: Trace): UIO[UIO[Unit]]
-
abstract
def
silent[R, E, A](zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
readLine(prompt: String)(implicit trace: Trace): IO[IOException, String]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
TestConsole
provides a testable interface for programs interacting with the console by modeling input and output as reading from and writing to input and output buffers maintained byTestConsole
and backed by aRef
.All calls to
print
andprintLine
using theTestConsole
will write the string to the output buffer and all calls toreadLine
will take a string from the input buffer. To facilitate debugging, by default output will also be rendered to standard output. You can enable or disable this for a scope usingdebug
,silent
, or the corresponding test aspects.TestConsole
has several methods to access and manipulate the content of these buffers includingfeedLines
to feed strings to the input buffer that will then be returned by calls toreadLine
,output
to get the content of the output buffer from calls toprint
andprintLine
, andclearInput
andclearOutput
to clear the respective buffers.Together, these functions make it easy to test programs interacting with the console.