exec

package
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShouldBeRuntimeError = assert.NewBinaryAssertion(IsRuntimeError)
)

Functions

func Array

func Array(expression string, expected []any, desc ...string) spec.Spec

func Error

func Error(expression string, desc ...string) spec.Spec

func ErrorAs

func ErrorAs(expression string, expected error, desc ...string) spec.Spec

func ErrorStr

func ErrorStr(expression string, expected string, desc ...string) spec.Spec

func Fn

func Fn(expression string, assertion assert.Unary, desc ...string) spec.Spec

func IsRuntimeError

func IsRuntimeError(actual, expected any) error

func Items

func Items(expression string, expected ...any) spec.Spec

func JSON

func JSON(expression string, expected string, desc ...string) spec.Spec

func Nil

func Nil(expression string, desc ...string) spec.Spec

func Object

func Object(expression string, expected map[string]any, desc ...string) spec.Spec

func RunProgramSpecs

func RunProgramSpecs(t *testing.T, specs []spec.Spec, opts ...vm.EnvironmentOption)

func RunRoundTrips

func RunRoundTrips(t *testing.T, cases []RoundTrip, opts ...vm.EnvironmentOption)

func RunRoundTripsWith

func RunRoundTripsWith(t *testing.T, name string, c *compiler.Compiler, cases []RoundTrip, opts ...vm.EnvironmentOption)

func RunSequenceFactory

func RunSequenceFactory(t *testing.T, factory func() []spec.Sequence, opts ...vm.EnvironmentOption)

func RunSequences

func RunSequences(t *testing.T, sequences []spec.Sequence, opts ...vm.EnvironmentOption)

func RunSequencesWith

func RunSequencesWith(t *testing.T, level compiler.OptimizationLevel, sequences []spec.Sequence, opts ...vm.EnvironmentOption)

func RunSpecFactory

func RunSpecFactory(t *testing.T, factory func() []spec.Spec, opts ...vm.EnvironmentOption)

func RunSpecs

func RunSpecs(t *testing.T, specs []spec.Spec, opts ...vm.EnvironmentOption)

func RunSpecsWith

func RunSpecsWith(t *testing.T, name string, c *compiler.Compiler, specs []spec.Spec, opts ...vm.EnvironmentOption)

func S

func S(expression string, expected any, desc ...string) spec.Spec

Types

type ExpectedRuntimeError

type ExpectedRuntimeError struct {
	Message     string
	Format      string
	Contains    []string
	NotContains []string
}

type RoundTrip

type RoundTrip struct {
	Input       spec.Input
	Expected    any
	Description string
	Env         []vm.EnvironmentOption
}

Jump to

Keyboard shortcuts

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