gocuelang.org/go/internal/cuetdtest Index | Files

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

Constants

const DefaultVersion = "v2"

Functions

func Run

func Run[TC any](t *testing.T, table []TC, fn func(t *T, tc *TC))

Run creates a new table-driven test using the CUE testing defaults.

Types

type M

type M struct {
	*testing.T
	// contains filtered or unexported fields
}

func (*M) Fallback

func (t *M) Fallback() string

func (*M) IsDefault

func (t *M) IsDefault() bool

func (*M) Name

func (t *M) Name() string

func (*M) Runtime

func (t *M) Runtime() *runtime.Runtime

Runtime creates a runtime that is configured according to the matrix.

func (*M) TODO_NoSharing

func (t *M) TODO_NoSharing()

func (*M) TODO_Sharing

func (t *M) TODO_Sharing()

func (*M) TODO_V3

func (t *M) TODO_V3()

func (*M) UpdateRuntime

func (t *M) UpdateRuntime(r *runtime.Runtime)

type Matrix

type Matrix []M
var DefaultOnlyMatrix Matrix = FullMatrix[:1]
var FullMatrix Matrix = []M{{
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}}
var SmallMatrix Matrix = FullMatrix[:2]

func (Matrix) Do

func (m Matrix) Do(t *testing.T, f func(t *M))

Do runs f for each configuration in the matrix.

func (Matrix) Run

func (m Matrix) Run(t *testing.T, name string, f func(t *M))

Run runs a test with the given name f for each configuration in the matrix.

type T

type T struct {
	*tdtest.T
	M *M
}

Source Files

cuetdtest.go matrix.go

Version
v0.9.0-alpha.5
Published
May 17, 2024
Platform
js/wasm
Imports
6 packages
Last checked
6 hours ago

Tools for package owners.