MockTerminalInput class

Mock input that allows queuing bytes and lines for testing.

Implemented types

Constructors

MockTerminalInput()

Properties

bytesRemaining int
Number of bytes remaining in queue.
no setter
echoMode bool
Whether input characters are echoed to output.
getter/setter pairoverride
hashCode int
The hash code for this object.
no setterinherited
hasTerminal bool
Whether a terminal is attached to stdin.
no setteroverride
lineMode bool
Whether input is line-buffered.
getter/setter pairoverride
linesRemaining int
Number of lines remaining in queue.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
queueByte(int byte) → void
Queue a single byte.
queueBytes(List<int> bytes) → void
Queue bytes to be returned by readByteSync.
queueKey(KeyEventType type, [String? char]) → void
Queue key events by type.
queueLine(String line) → void
Queue a line to be returned by readLineSync.
queueLines(List<String> lines) → void
Queue multiple lines.
queueString(String str) → void
Queue a string as bytes (UTF-8).
readByteSync() int
Reads a single byte synchronously from input.
override
readLineSync() String?
Reads a line synchronously from input.
override
reset() → void
Reset the input state.
setHasTerminal(bool value) → void
Set whether terminal is available.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited