cmdtest

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(t *testing.T, cmd *cobra.Command, args []string, want error) string

Error expects cmd to fail with an error that unwraps to want. Error returns the command output but does not validate the output.

func Output

func Output(t *testing.T, cmd *cobra.Command, args []string, want any) string

Output expects cmd to output fmt.Sprint(want) and returns the actual output.

func TableOutput

func TableOutput(t *testing.T, cmd *cobra.Command, args []string, want [][]string, colorize func(any) aurora.Value) string

TableOutput expects cmd to output want as a table and returns the actual output. If colorize is non-nil, it is used to colorize the expected output before comparing to the actual output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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