terminaltest

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package terminaltest gives a package's tests the same standard streams and the same text styling whether a terminal, a pipe or go test started them.

The commands ask whether standard output is a terminal before they color text, open a pager or read the window size. A test binary that a release runs from a maintainer's terminal would get other answers than go test gives, so its tests would color text or wait in a pager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(m *testing.M)

Run runs a package's tests away from the terminal. Call it from TestMain and return, so the test runner sets the exit code and writes coverage data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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