termtest

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package termtest provides utilities for testing terminal-based programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTerm

func WithTerm()

WithTerm is an entry point for a command line program "with-term". Its usage is as follows:

with-term [options] script -- cmd [args ...]

It runs cmd with the given arguments inside a terminal emulator, using the script file to drive interactions with it.

The file contains a series of newline delimited commands.

await Enter a name
feed Foo\r
snapshot

See uitest.Script for more details on the script format. The following options may be provided before the script file.

  • -cols int: terminal width (default 80)
  • -rows int: terminal height (default 40)
  • -fixed: don't auto-grow the terminal as output increases
  • -final <name>: print a final snapshot on exit to stdout with the given name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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