InMemoryTerminal class final
A FIFO-scripted Terminal that records every command, write, and read.
- Implemented types
Constructors
-
InMemoryTerminal({bool interactive = true, List<
String> input = const <String>[]}) - Creates a terminal fake.
Properties
-
commands
→ List<
TerminalCommand> -
Every invocation passed to run, in call order.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interactive → bool
-
Whether this terminal is attached to an interactive session.
final
-
reads
→ List<
TerminalRead> -
Every read request passed to readLine, in call order.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
writes
→ List<
TerminalWrite> -
Every write passed to write, in call order.
final
Methods
-
enqueue(
Result< TerminalOutput> result) → void - Scripts the next run answer.
-
enqueueReadResult(
Result< String?> result) → void - Scripts the next readLine answer.
-
enqueueWriteResult(
Result< void> result) → void - Scripts the next write answer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readLine(
[TerminalRead input = const TerminalRead()]) → Future< Result< String?> > -
Reads one line, or
Ok(null)at end of input.override -
run(
TerminalCommand command) → Future< Result< TerminalOutput> > -
Runs
command, returning launch failures asResultfailures.override -
toString(
) → String -
A string representation of this object.
inherited
-
write(
TerminalWrite output) → Future< Result< void> > -
Writes
outputto the session.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited