Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempfile

func CreateTempfile(tb testing.TB, b []byte) *os.File

CreateTempfile that will be closed and removed at the end of the test.

func DeleteTempfile

func DeleteTempfile(f *os.File, t *testing.T)

func WaitForContents added in v0.16.0

func WaitForContents(t *testing.T, d time.Duration, p, c string)

Types

type Tenancy added in v0.37.0

type Tenancy struct {
	Partition string
	Namespace string
}

type TenancyHelper added in v0.37.0

type TenancyHelper struct {
	// contains filtered or unexported fields
}

func NewTenancyHelper added in v0.37.0

func NewTenancyHelper(consulClient *api.Client) (*TenancyHelper, error)

func (*TenancyHelper) AppendTenancyInfo added in v0.37.0

func (t *TenancyHelper) AppendTenancyInfo(name string, tenancy *Tenancy) string

func (*TenancyHelper) GenerateDefaultTenancyTests added in v0.37.0

func (t *TenancyHelper) GenerateDefaultTenancyTests(generationFunc func(tenancy *Tenancy) []interface{}) []interface{}

func (*TenancyHelper) GenerateNonDefaultTenancyTests added in v0.37.0

func (t *TenancyHelper) GenerateNonDefaultTenancyTests(generationFunc func(tenancy *Tenancy) []interface{}) []interface{}

func (*TenancyHelper) GenerateTenancyTests added in v0.37.0

func (t *TenancyHelper) GenerateTenancyTests(generationFunc func(tenancy *Tenancy) []interface{}) []interface{}

func (*TenancyHelper) GetUniquePartitions added in v0.37.0

func (t *TenancyHelper) GetUniquePartitions() map[api.Partition]interface{}

func (*TenancyHelper) IsConsulEnterprise added in v0.37.0

func (t *TenancyHelper) IsConsulEnterprise() bool

func (*TenancyHelper) RunWithTenancies added in v0.37.0

func (t *TenancyHelper) RunWithTenancies(testFunc func(tenancy *Tenancy), test *testing.T, testName string)

func (*TenancyHelper) Tenancy added in v0.37.0

func (t *TenancyHelper) Tenancy(s string) *Tenancy

Tenancy constructs a Tenancy from a concise string representation suitable for use in unit tests.

- "" : partition="" namespace="" - "foo" : partition="foo" namespace="" - "foo.bar" : partition="foo" namespace="bar" - <others> : partition="BAD" namespace="BAD"

func (*TenancyHelper) TestTenancies added in v0.37.0

func (t *TenancyHelper) TestTenancies() []*Tenancy

TestTenancies returns a list of tenancies which represent the namespace and partition combinations that can be used in unit tests

type TestingTB added in v0.25.2

type TestingTB struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*TestingTB) Cleanup added in v0.25.2

func (t *TestingTB) Cleanup(f func())

func (*TestingTB) DoCleanup added in v0.25.2

func (t *TestingTB) DoCleanup()

func (*TestingTB) Error added in v0.39.0

func (*TestingTB) Error(...any)

func (*TestingTB) Errorf added in v0.39.0

func (*TestingTB) Errorf(string, ...any)

func (*TestingTB) Fail added in v0.39.0

func (*TestingTB) Fail()

func (*TestingTB) FailNow added in v0.39.0

func (*TestingTB) FailNow()

func (*TestingTB) Failed added in v0.25.2

func (*TestingTB) Failed() bool

func (*TestingTB) Fatal added in v0.39.0

func (*TestingTB) Fatal(...any)

func (*TestingTB) Fatalf added in v0.29.2

func (*TestingTB) Fatalf(string, ...interface{})

func (*TestingTB) Helper added in v0.29.2

func (*TestingTB) Helper()

func (*TestingTB) Log added in v0.39.0

func (*TestingTB) Log(...any)

func (*TestingTB) Logf added in v0.25.2

func (*TestingTB) Logf(string, ...interface{})

func (*TestingTB) Name added in v0.25.2

func (*TestingTB) Name() string

func (*TestingTB) Setenv added in v0.39.0

func (*TestingTB) Setenv(string, string)

func (*TestingTB) TempDir added in v0.39.0

func (*TestingTB) TempDir() string

Jump to

Keyboard shortcuts

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