Documentation
¶
Overview ¶
Package tcontext carries block- and runner-scoped test state through context.Context. Shared state belongs to a block; local state belongs to a runner. Lookups provide required-value, nullable-value, and presence-only operations.
Index ¶
- func Contains(ctx context.Context, key string) bool
- func Get(ctx context.Context, key string) (any, bool)
- func Keys(ctx context.Context) []string
- func Remove(ctx context.Context, key string)
- func Resolve(ctx context.Context, key string) (any, error)
- func ResolveString(ctx context.Context, key string) (string, error)
- func Set(ctx context.Context, key string, value any) error
- func WithLocal(ctx context.Context, l *Local) context.Context
- func WithShared(ctx context.Context, s *Shared) context.Context
- type Local
- type Shared
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
Resolve returns a required value or an error. Optional angle brackets around the key are accepted.
func ResolveString ¶
ResolveString resolves a required string value.
Types ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local is runner-scoped state shared by scenarios in that runner.
type Shared ¶
type Shared struct {
// contains filtered or unexported fields
}
Shared is block-scoped state populated during boot and read by its runners.
Click to show internal directories.
Click to hide internal directories.