package testtrace
import "golang.org/x/exp/trace/internal/testtrace"
Index ¶
- type Expectation
- func ExpectSuccess() *Expectation
- func ParseExpectation(data []byte) (*Expectation, error)
- func ParseFile(testPath string) (io.Reader, *Expectation, error)
- func (e *Expectation) Check(err error) error
- type Validator
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, *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 { Go121 bool // 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 ¶
Event validates ev as the next event in a stream of trace.Events.
Returns an error if validation fails.
Source Files ¶
expectation.go format.go validation.go
- Version
- v0.0.0-20250218142911-aa4b98e5adaa (latest)
- Published
- Feb 18, 2025
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 3 days ago –
Tools for package owners.