testutil

package
v1.10.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package testutil provides shared test helpers for both the machine/ and machine/compilation/ test suites. It exists to break the import cycle between machine (which cannot import compilation) and tests that need both packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalScheme

func EvalScheme(t *testing.T, code string) values.Value

EvalScheme evaluates one or more Scheme expressions and returns the last value. Fails the test on any error.

func EvalSchemeInEnv

func EvalSchemeInEnv(t *testing.T, env *environment.EnvironmentFrame, code string) values.Value

EvalSchemeInEnv evaluates one or more Scheme expressions in the given environment and returns the last value.

func NewFullRuntimeEnv

func NewFullRuntimeEnv(t *testing.T) *environment.EnvironmentFrame

NewFullRuntimeEnv creates a full runtime environment with all primitives and bootstrap macros registered.

func NewMinimalNamespace

func NewMinimalNamespace(env *environment.EnvironmentFrame) *environment.EnvironmentFrame

NewMinimalNamespace creates a minimal namespace with core special form bindings registered (if, lambda, quote, etc.). Useful for unit tests that need compilation without a full bootstrap.

func NewTopLevelThunk

NewTopLevelThunk expands, compiles, and wraps a syntax value into a continuation ready for MachineContext.Run().

func ParseSchemeExpr

func ParseSchemeExpr(t *testing.T, env *environment.EnvironmentFrame, code string) syntax.SyntaxValue

ParseSchemeExpr parses a single Scheme expression from code.

func SetupLibraryTest

func SetupLibraryTest(t *testing.T, testdataPath string) *environment.EnvironmentFrame

SetupLibraryTest creates a test environment with library loading capability, using the testdata/ directory at the given path as the library search path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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