Documentation
¶
Index ¶
- func Compile(expression string, level ...compiler.OptimizationLevel) (*bytecode.Program, error)
- func Exec(p *bytecode.Program, raw bool, opts ...vm.EnvironmentOption) (any, error)
- func ExecInstance(instance *vm.VM, raw bool, env *vm.Environment) (any, error)
- func ExecWith(p *bytecode.Program, raw bool, vmOpts []vm.Option, ...) (any, error)
- func ForWhileHelpers() runtime.FunctionDefs
- func PrintDebug(t *testing.T, name string, prog *bytecode.Program)
- func PrintError(t *testing.T, err error)
- func Run(p *bytecode.Program, opts ...vm.EnvironmentOption) ([]byte, error)
- func RunBenchmark(b *testing.B, expression string, opts ...vm.EnvironmentOption)
- func RunBenchmarkWith(b *testing.B, c *compiler.Compiler, expression string, ...)
- func RunBenchmarkWithOptimization(b *testing.B, expression string, level compiler.OptimizationLevel, ...)
- func RunInstance(instance *vm.VM, env *vm.Environment) ([]byte, error)
- func RunOutputBenchmark(b *testing.B, expression string, opts ...vm.EnvironmentOption)
- func RunOutputBenchmarkWith(b *testing.B, c *compiler.Compiler, expression string, ...)
- func RunOutputBenchmarkWithOptimization(b *testing.B, expression string, level compiler.OptimizationLevel, ...)
- func RunResultBenchmark(b *testing.B, expression string, opts ...vm.EnvironmentOption)
- func RunResultBenchmarkWith(b *testing.B, c *compiler.Compiler, expression string, ...)
- func RunResultBenchmarkWithOptimization(b *testing.B, expression string, level compiler.OptimizationLevel, ...)
- func RunWith(p *bytecode.Program, vmOpts []vm.Option, opts ...vm.EnvironmentOption) ([]byte, error)
- func StateFn[T any](fn runtime.Function, factory func(ctx context.Context) T) runtime.Function
- func Stdlib() runtime.Namespace
- func WithParam(name string, value any) vm.EnvironmentOption
- type BaseSpec
- type CompileInfo
- type ExecInfo
- type Expectation
- type ExpectationBuilder
- type FnState
- type Input
- type Outcomes
- type ProgramBuilder
- type ProgramSource
- type Runner
- type Sequence
- type SequenceRunner
- type SequenceStep
- type Skip
- type Spec
- func (s Spec) Debug() Spec
- func (s Spec) Env(o ...vm.EnvironmentOption) Spec
- func (s Spec) Expect() ExpectationBuilder[Spec]
- func (s Spec) Merge(other Spec) Spec
- func (s Spec) Raw() Spec
- func (s Spec) Skip(reason ...string) Spec
- func (s Spec) String() string
- func (s Spec) Suffix(suffix string) Spec
- func (s Spec) SuiteName(suite string) string
- func (s Spec) VM(o ...vm.Option) Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecInstance ¶
func ForWhileHelpers ¶
func ForWhileHelpers() runtime.FunctionDefs
func PrintError ¶
func RunBenchmark ¶
func RunBenchmark(b *testing.B, expression string, opts ...vm.EnvironmentOption)
func RunBenchmarkWith ¶
func RunBenchmarkWithOptimization ¶
func RunBenchmarkWithOptimization(b *testing.B, expression string, level compiler.OptimizationLevel, opts ...vm.EnvironmentOption)
func RunInstance ¶
func RunOutputBenchmark ¶
func RunOutputBenchmark(b *testing.B, expression string, opts ...vm.EnvironmentOption)
func RunOutputBenchmarkWith ¶
func RunOutputBenchmarkWithOptimization ¶
func RunOutputBenchmarkWithOptimization(b *testing.B, expression string, level compiler.OptimizationLevel, opts ...vm.EnvironmentOption)
func RunResultBenchmark ¶
func RunResultBenchmark(b *testing.B, expression string, opts ...vm.EnvironmentOption)
func RunResultBenchmarkWith ¶
func RunResultBenchmarkWithOptimization ¶
func RunResultBenchmarkWithOptimization(b *testing.B, expression string, level compiler.OptimizationLevel, opts ...vm.EnvironmentOption)
Types ¶
type CompileInfo ¶
type CompileInfo struct {
Outcomes
}
func (CompileInfo) Merge ¶
func (c CompileInfo) Merge(other CompileInfo) CompileInfo
type Expectation ¶
func NewExpectation ¶
func NewExpectation(fn assert.Assertion, val ...any) Expectation
func (Expectation) Defined ¶
func (exp Expectation) Defined() bool
func (Expectation) Merge ¶
func (exp Expectation) Merge(other Expectation) Expectation
type ExpectationBuilder ¶
type ExpectationBuilder[T any] struct { // contains filtered or unexported fields }
func NewExpectationBuilder ¶
func NewExpectationBuilder[T any](ret *T, base func(*T) *Spec) ExpectationBuilder[T]
func (ExpectationBuilder[T]) Compile ¶
func (b ExpectationBuilder[T]) Compile(fn assert.Assertion, val ...any) T
func (ExpectationBuilder[T]) CompileError ¶
func (b ExpectationBuilder[T]) CompileError(fn assert.Assertion, val ...any) T
type Input ¶
type Input struct {
Source ProgramSource
Expression string
}
func NewExpressionInput ¶
func NewProgramSourceInput ¶
func NewProgramSourceInput(source ProgramSource) Input
func (Input) ResolveProgram ¶
type Outcomes ¶
type Outcomes struct {
Result Expectation
Error Expectation
}
type ProgramBuilder ¶
type ProgramSource ¶
type ProgramSource struct {
Build ProgramBuilder
Name string
}
type Runner ¶
type Runner struct {
Name string
Compiler *compiler.Compiler
Env []vm.EnvironmentOption
}
type Sequence ¶
type Sequence struct {
Env []vm.EnvironmentOption
VM []vm.Option
Steps []SequenceStep
Base BaseSpec
}
func NewSequence ¶
type SequenceRunner ¶
type SequenceRunner struct {
Name string
Compiler *compiler.Compiler
Env []vm.EnvironmentOption
}
func NewSequenceRunner ¶
func NewSequenceRunner(suite string, opts ...compiler.Option) *SequenceRunner
type SequenceStep ¶
type SequenceStep struct {
Result Expectation
Error Expectation
Panic Expectation
EnvFactory func() (*vm.Environment, error)
Name string
Env []vm.EnvironmentOption
}
func ResultStep ¶
func ResultStep(name string, fn assert.Assertion, val ...any) SequenceStep
type Spec ¶
type Spec struct {
Base BaseSpec
Compile CompileInfo
Exec ExecInfo
}
func NewSpecWith ¶
func (Spec) Expect ¶
func (s Spec) Expect() ExpectationBuilder[Spec]
Source Files
¶
Click to show internal directories.
Click to hide internal directories.