dcli.testing
0.2.0-rc.4
dotnet add package dcli.testing --version 0.2.0-rc.4
NuGet\Install-Package dcli.testing -Version 0.2.0-rc.4
<PackageReference Include="dcli.testing" Version="0.2.0-rc.4" />
<PackageVersion Include="dcli.testing" Version="0.2.0-rc.4" />
<PackageReference Include="dcli.testing" />
paket add dcli.testing --version 0.2.0-rc.4
#r "nuget: dcli.testing, 0.2.0-rc.4"
#:package dcli.testing@0.2.0-rc.4
#addin nuget:?package=dcli.testing&version=0.2.0-rc.4&prerelease
#tool nuget:?package=dcli.testing&version=0.2.0-rc.4&prerelease
dcli.testing
Headless test harness for the dcli inline terminal-rendering library.
dcli.testing lets you drive the real dcli render engine — input parser, fixed-region composer,
scrollback model, overlays, virtual clock — against in-memory fakes instead of a real TTY.
No PTY, no raw mode, no ANSI pollution in your test output.
Quick start
using Dcli;
using Dcli.Testing;
using Xunit;
public class MyFeatureTests
{
[Fact]
public async Task StatusLineAppearsInSnapshot()
{
await using HeadlessTerminal harness = await HeadlessTerminal.StartAsync();
harness.Terminal.Status.SetRows([new Line([new Segment("Ready")])]);
await harness.SettleAsync();
FrameSnapshot snap = harness.Snapshot;
string pretty = FrameSnapshotPrinter.PrettyPrint(snap);
Assert.Contains("Ready", pretty);
}
}
Key types
| Type | Description |
|---|---|
HeadlessTerminal |
Entry point. StartAsync() builds a live harness; SettleAsync() drains pending work and waits for a coalesced frame. |
HeadlessTerminalOptions |
Configures initial size, minimum frame interval, and virtual clock. |
VirtualClock |
Deterministic clock; Advance(span) advances time without wall-clock delay, triggering throttled paints. |
FrameSnapshot |
Immutable capture of LiveWindowRows, FixedRegionRows, caret, size, newly-committed rows, and overlay state. |
FrameSnapshotPrinter |
PrettyPrint(snapshot) — ASCII-bordered, style-stripped frame string, stable for golden-frame assertions. |
Scripting methods
| Method | What it does |
|---|---|
SendKey(KeyEvent) |
Injects a named or character key directly into the render loop. |
Type(string) |
Types each rune as a Char key event. For named keys (Enter, Tab, arrows) use SendKey. |
Paste(string) |
Posts a bracketed-paste event. |
Feed(ReadOnlySpan<byte>) |
Feeds raw bytes through the real VT parser on the InputReader thread. |
Resize(cols, rows) |
Triggers a resize event via the same path as POSIX SIGWINCH. |
What's NOT here
This package contains only the headless harness. The production dcli rendering engine,
public API (ITerminal, Scrollback, Input, Status, Autocomplete), and event model
live in the dcli package. Add both packages to test projects:
<PackageReference Include="dcli" Version="0.1.0-rc.1" />
<PackageReference Include="dcli.testing" Version="0.1.0-rc.1" />
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- dcli (>= 0.2.0-rc.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.2.0-rc.4 | 0 | 5/31/2026 |
| 0.2.0-rc.2 | 56 | 5/28/2026 |
Headless test harness for dcli: HeadlessTerminal, scripted input drivers, deterministic SettleAsync, virtual clock, structured frame Snapshot.