test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestRootCommand

func NewTestRootCommand(t testing.TB, opts ...*TestOption) *cobra.Command

NewTestRootCommand sets `fyt` root command for testing needs.

Types

type TestOption

type TestOption struct {
	// ConfigLocation keeps where config is located.
	ConfigLocation string
	// Envs supplies environment overrides as NAME=value entries.
	// MergeTestOptions accumulates entries from all options in their supplied order.
	Envs   []string
	StdOut io.Writer
	StdErr io.Writer
}

TestOption keeps different options for testing commands.

func MergeTestOptions

func MergeTestOptions(_ testing.TB, opts ...*TestOption) *TestOption

MergeTestOptions merges testing options into single TestOption object.

func TOptConfigLocation

func TOptConfigLocation(location string) *TestOption

TOptConfigLocation sets config location as TestOption object

func TOptEnv

func TOptEnv(name, value string) *TestOption

TOptEnv supplies an environment variable as a TestOption object.

func TOptEnvs

func TOptEnvs(envs []string) *TestOption

TOptEnvs supplies environment variable overrides for TestOption.

func TOptStdErr

func TOptStdErr(stderr io.Writer) *TestOption

TOptStdErr sets stderr for TestOption object

func TOptStdOut

func TOptStdOut(stdout io.Writer) *TestOption

TOptStdOut sets stdout for TestOption object

func (*TestOption) Env

func (o *TestOption) Env(name string) (val string)

Env returns the first matching value from TestOption.Envs, or an empty string.

Jump to

Keyboard shortcuts

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