package cuetdtest
import "cuelang.org/go/internal/cuetdtest"
Package testing is a helper package for test packages in the CUE project. As such it should only be imported in _test.go files.
Index ¶
- func Run[TC any](t *testing.T, table []TC, fn func(t *T, tc *TC))
- type M
- func (t *M) CueContext() *cue.Context
- func (t *M) Fallback() string
- func (t *M) IsDefault() bool
- func (t *M) Name() string
- func (t *M) Runtime() *runtime.Runtime
- func (m *M) TODO_NoSharing(t testing.TB)
- func (m *M) TODO_Sharing(t testing.TB)
- type Matrix
- func (m Matrix) Do(t *testing.T, f func(t *testing.T, m *M))
- func (m Matrix) Run(t *testing.T, name string, f func(t *testing.T, m *M))
- type T
Functions ¶
func Run ¶
Run creates a new table-driven test using the CUE testing defaults.
Types ¶
type M ¶
type M struct {
// Flags is public to allow tests to customise e.g. logging.
Flags cuedebug.Config
// contains filtered or unexported fields
}
M represents a point in the evaluation matrix of possible runtime configurations.
func (*M) CueContext ¶
func (*M) Fallback ¶
func (*M) IsDefault ¶
IsDefault reports whether this matrix entry should be considered "default" for this matrix.
func (*M) Name ¶
func (*M) Runtime ¶
Runtime creates a runtime that is configured according to the matrix.
func (*M) TODO_NoSharing ¶
func (*M) TODO_Sharing ¶
type Matrix ¶
type Matrix []M
Matrix represents a set of possible parameters to run tests over. The first entry in the slice is considered the "default" and can be used to choose a specific entry to record values for (for example test statistics or error message output).
func (Matrix) Do ¶
Do runs f in a subtest for each configuration in the matrix.
func (Matrix) Run ¶
Run runs a subtest with the given name that invokes a further subtest for each configuration in the matrix.
type T ¶
Source Files ¶
cuetdtest.go matrix.go
- Version
- v0.15.1 (latest)
- Published
- Nov 21, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 4 months ago –
Tools for package owners.