TestBackend class

In-memory terminal backend for testing.

Stores drawn cells in a Buffer for assertion. Does not interact with a real terminal.

Implemented types

Constructors

TestBackend(int width, int height)
TestBackend.withLines(List<String> lines)

Properties

buffer Buffer
no setter
cursorPosition Position
no setter
cursorVisible bool
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

assertBufferLines(List<String> expected) → void
clear() → void
Clear the entire terminal display.
override
clearRegion(ClearType type) → void
override
draw(Iterable<CellUpdate> updates) → void
Write cell updates to the terminal display.
override
flush() → void
Flush any buffered output to the terminal.
override
getCursorPosition() Position
override
hideCursor() → void
Hide the terminal cursor.
override
keyEvents() Stream<KeyEvent>
Stream of keyboard events from terminal input.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize(int width, int height) → void
resizeEvents() Stream<Size>
Stream of terminal resize events.
override
setAlternateScreen(bool enabled) → void
Switch to or from the terminal alternate screen buffer.
override
setCursorPosition(Position pos) → void
override
setRawMode(bool enabled) → void
Enable or disable raw input mode (line buffering, echo).
override
showCursor() → void
Show the terminal cursor.
override
size() Size
override
toString() String
A string representation of this object.
inherited

Operators

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