testtrace

package standard library
master (86fca3d) Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expectation

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

Expectation represents the expected result of some operation.

func ExpectSuccess

func ExpectSuccess() *Expectation

ExpectSuccess returns an Expectation that trivially expects success.

func ParseExpectation

func ParseExpectation(data []byte) (*Expectation, error)

ParseExpectation parses the serialized form of an Expectation.

func ParseFile

func ParseFile(testPath string) (io.Reader, version.Version, *Expectation, error)

ParseFile parses a test file generated by the testgen package.

func (*Expectation) Check

func (e *Expectation) Check(err error) error

Check validates whether err conforms to the expectation. Returns an error if it does not conform.

Conformance means that if failure is true, then err must be non-nil. If err is non-nil, then it must match errorMatcher.

type Validator

type Validator struct {
	GoVersion version.Version
	// contains filtered or unexported fields
}

Validator is a type used for validating a stream of trace.Events.

func NewValidator

func NewValidator() *Validator

NewValidator creates a new Validator.

func (*Validator) Event

func (v *Validator) Event(ev trace.Event) error

Event validates ev as the next event in a stream of trace.Events.

Returns an error if validation fails.

func (*Validator) SkipClockSnapshotChecks

func (v *Validator) SkipClockSnapshotChecks()

SkipClockSnapshotChecks causes the validator to skip checks on the clock snapshots.

Some platforms like Windows, with a small enough trace period, are unable to produce monotonically increasing timestamps due to very coarse clock granularity.

Jump to

Keyboard shortcuts

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