doubles

package
v0.182.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecorderTB

type RecorderTB struct {
	testing.TB
	// Passthrough is a flag that makes the recorder act as a passthrough proxy to the .TB field.
	Passthrough bool
	IsFailed    bool
	IsSkipped   bool
	// contains filtered or unexported fields
}

func (*RecorderTB) Cleanup

func (rtb *RecorderTB) Cleanup(f func())

func (*RecorderTB) CleanupNow

func (rtb *RecorderTB) CleanupNow()

func (*RecorderTB) Error

func (rtb *RecorderTB) Error(args ...interface{})

func (*RecorderTB) Errorf

func (rtb *RecorderTB) Errorf(format string, args ...interface{})

func (*RecorderTB) Fail

func (rtb *RecorderTB) Fail()

func (*RecorderTB) FailNow

func (rtb *RecorderTB) FailNow()

func (*RecorderTB) Failed

func (rtb *RecorderTB) Failed() bool

func (*RecorderTB) Fatal

func (rtb *RecorderTB) Fatal(args ...interface{})

func (*RecorderTB) Fatalf

func (rtb *RecorderTB) Fatalf(format string, args ...interface{})

func (*RecorderTB) Forward

func (rtb *RecorderTB) Forward()

func (*RecorderTB) ForwardLogs added in v0.181.0

func (rtb *RecorderTB) ForwardLogs()

func (*RecorderTB) Helper

func (rtb *RecorderTB) Helper()

func (*RecorderTB) Log

func (rtb *RecorderTB) Log(args ...interface{})

func (*RecorderTB) Logf

func (rtb *RecorderTB) Logf(format string, args ...interface{})

func (*RecorderTB) Pass added in v0.181.0

func (rtb *RecorderTB) Pass()

Pass is an API to communicate with the TB that an assertion passed

func (*RecorderTB) Passes added in v0.181.0

func (rtb *RecorderTB) Passes() int

func (*RecorderTB) Run

func (rtb *RecorderTB) Run(_ string, blk func(testing.TB)) bool

func (*RecorderTB) Setenv

func (rtb *RecorderTB) Setenv(key, value string)

func (*RecorderTB) Skip added in v0.181.0

func (rtb *RecorderTB) Skip(args ...any)

func (*RecorderTB) SkipNow added in v0.181.0

func (rtb *RecorderTB) SkipNow()

func (*RecorderTB) Skipped added in v0.181.0

func (rtb *RecorderTB) Skipped() bool

type TB

type TB struct {
	// TB is an optional value here.
	// If provided, some default behaviour might be taken from it, like TempDir.
	//
	// It also helps implement testing.TB interface's with embedding.
	testing.TB

	IsFailed  bool
	IsSkipped bool
	Logs      bytes.Buffer

	StubName     string
	StubNameFunc func() string
	StubTempDir  string
	OnFailNow    func()
	OnSkipNow    func()

	Tests []*TB
	// contains filtered or unexported fields
}

func (*TB) Chdir added in v0.181.0

func (m *TB) Chdir(dir string)

Chdir calls os.Chdir(dir) and uses Cleanup to restore the current working directory to its original value after the test. It also sets PWD environment variable for the duration of the test.

func (*TB) Cleanup

func (m *TB) Cleanup(f func())

func (*TB) Context added in v0.181.0

func (m *TB) Context() context.Context

func (*TB) Error

func (m *TB) Error(args ...any)

func (*TB) Errorf

func (m *TB) Errorf(format string, args ...any)

func (*TB) Fail

func (m *TB) Fail()

func (*TB) FailNow

func (m *TB) FailNow()

func (*TB) Failed

func (m *TB) Failed() bool

func (*TB) Fatal

func (m *TB) Fatal(args ...any)

func (*TB) Fatalf

func (m *TB) Fatalf(format string, args ...any)

func (*TB) Finish

func (m *TB) Finish()

func (*TB) Helper

func (m *TB) Helper()

func (*TB) LastRunTB

func (m *TB) LastRunTB() (*TB, bool)

func (*TB) LastTB

func (m *TB) LastTB() *TB

func (*TB) Log

func (m *TB) Log(args ...any)

func (*TB) Logf

func (m *TB) Logf(format string, args ...any)

func (*TB) Name

func (m *TB) Name() string

func (*TB) Pass added in v0.181.0

func (m *TB) Pass()

func (*TB) Passes added in v0.181.0

func (m *TB) Passes() int

func (*TB) Run

func (m *TB) Run(name string, blk func(tb testing.TB)) bool

func (*TB) Setenv

func (m *TB) Setenv(key, value string)

func (*TB) Skip

func (m *TB) Skip(args ...any)

func (*TB) SkipNow

func (m *TB) SkipNow()

func (*TB) Skipf

func (m *TB) Skipf(format string, args ...any)

func (*TB) Skipped

func (m *TB) Skipped() bool

func (*TB) TempDir

func (m *TB) TempDir() string

Jump to

Keyboard shortcuts

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