TestConsole

object TestConsole extends Serializable
Companion:
class
class Object
trait Matchable
class Any

Type members

Classlikes

final case class Data(input: List[String], output: Vector[String], errOutput: Vector[String])

The state of the TestConsole.

The state of the TestConsole.

case class Test(consoleState: Atomic[Data], live: Live, annotations: Annotations, debugState: FiberRef[Boolean]) extends Console with TestConsole

Value members

Concrete methods

def clearInput(implicit trace: Trace): UIO[Unit]

Accesses a TestConsole instance in the environment and clears the input buffer.

Accesses a TestConsole instance in the environment and clears the input buffer.

def clearOutput(implicit trace: Trace): UIO[Unit]

Accesses a TestConsole instance in the environment and clears the output buffer.

Accesses a TestConsole instance in the environment and clears the output buffer.

def debug[R, E, A](zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to debug mode, so that console output is rendered to standard output in addition to being written to the output buffer.

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to debug mode, so that console output is rendered to standard output in addition to being written to the output buffer.

def feedLines(lines: String*)(implicit trace: Trace): UIO[Unit]

Accesses a TestConsole instance in the environment and writes the specified sequence of strings to the input buffer.

Accesses a TestConsole instance in the environment and writes the specified sequence of strings to the input buffer.

def make(data: Data, debug: Boolean)(implicit trace: Trace): ZLayer[Live & Annotations, Nothing, TestConsole]

Constructs a new Test object that implements the TestConsole interface. This can be useful for mixing in with implementations of other interfaces.

Constructs a new Test object that implements the TestConsole interface. This can be useful for mixing in with implementations of other interfaces.

def output(implicit trace: Trace): UIO[Vector[String]]

Accesses a TestConsole instance in the environment and returns the contents of the output buffer.

Accesses a TestConsole instance in the environment and returns the contents of the output buffer.

def outputErr(implicit trace: Trace): UIO[Vector[String]]

Accesses a TestConsole instance in the environment and returns the contents of the error buffer.

Accesses a TestConsole instance in the environment and returns the contents of the error buffer.

def save(implicit trace: Trace): UIO[UIO[Unit]]

Accesses a TestConsole instance in the environment and saves the console state in an effect which, when run, will restore the TestConsole to the saved state.

Accesses a TestConsole instance in the environment and saves the console state in an effect which, when run, will restore the TestConsole to the saved state.

def silent[R, E, A](zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to silent mode, so that console output is only written to the output buffer and not rendered to standard output.

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to silent mode, so that console output is only written to the output buffer and not rendered to standard output.

Concrete fields