teatest

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertExactWidth

func AssertExactWidth(t *testing.T, expected int, output string)

AssertExactWidth fails if the widest line in output doesn't equal expected.

func AssertMaxWidth

func AssertMaxWidth(t *testing.T, maxWidth int, output string)

AssertMaxWidth fails if any line in output exceeds maxWidth.

func AssertNoRawEscapes

func AssertNoRawEscapes(t *testing.T, output string)

AssertNoRawEscapes fails if any line contains a broken/visible escape sequence. A raw escape looks like "38;2;110;231;183m" — ANSI parameters without the leading ESC[.

func DrainCmds added in v1.18.0

func DrainCmds(update func(tea.Msg) tea.Cmd, cmd tea.Cmd, maxSteps int)

DrainCmds executes a tea.Cmd and feeds resulting messages back through the update function. Handles tea.BatchMsg by expanding and executing each sub-command.

Each cmd is executed with a timeout. Cmds that block (e.g. channel reads waiting on a stream) are skipped. This makes DrainCmds safe to use with models that have in-flight async work.

Stops after maxSteps to prevent infinite loops in tests.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL