Documentation
¶
Overview ¶
Package clitest provides utilities for testing command-line applications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Case ¶
type Case[App cli.App] struct { // Args are the command-line arguments to pass to the application. Args []string // Env are the environment variables to set before running the application. Env map[string]string // WantErr is the expected error to be returned by the application, checked // with errors.Is. WantErr error // WantErrType is the expected type of the error to be returned by the // application, checked with errors.As. WantErrType error // WantNothingPrinted indicates that no output should be printed to stdout or // stderr. WantNothingPrinted bool // WantInStdout is the expected substring to be present in the stdout output. WantInStdout string // WantInStderr is the expected substring to be present in the stderr output. WantInStderr string // CheckFunc is an optional function to perform additional checks after the // application has run. CheckFunc func(*testing.T, App) }
Case represents a single test case for a command-line application.
Click to show internal directories.
Click to hide internal directories.