nocterm_test library
Testing utilities for TUI applications.
Provides a Flutter-like testing framework for terminal user interfaces.
Classes
- KeyboardEvent
- Represents a keyboard event.
- LogicalKey
- Represents a logical keyboard key.
- NoctermTester
- Main testing interface for TUI applications. Provides methods for rendering frames, simulating input, and inspecting state.
- StyledText
- Represents a styled text segment in the terminal
- TerminalState
- Represents the state of a terminal at a point in time. Provides methods for querying and asserting on terminal content.
- TextMatch
- Represents a text match found in the terminal
Constants
- isEmpty → const Matcher
- Matches if terminal is empty
Properties
- isNotEmpty → Matcher
-
Matches if terminal is not empty
no setter
Functions
-
containsText(
String text) → Matcher - Matches if terminal contains the specified text
-
hasStyledText(
String text, TextStyle style) → Matcher - Matches if terminal has styled text
-
hasTextAt(
int x, int y, String text) → Matcher - Matches if terminal has text at the specified position
-
matchesSnapshot(
String snapshot) → Matcher - Matches if terminal state matches snapshot
-
testNocterm(
String description, TuiTestCallback callback, {Size size = const Size(80, 24), bool skip = false, bool debugPrintAfterPump = false, Duration? timeout}) → Future< void> - Run a TUI test with automatic setup and teardown
Typedefs
-
TuiTestCallback
= Future<
void> Function(NoctermTester tester) - Function signature for TUI test callbacks