Documentation
¶
Overview ¶
Package testutil provides testing utilities for asimonim.
Index ¶
- func LoadFixtureFile(t *testing.T, fixturePath string) []byte
- func NewFixtureFS(t *testing.T, fixtureDir string, rootPath string) *mapfs.MapFileSystem
- func ParseFixtureTokens(t *testing.T, fixtureDir string, schemaVersion schema.Version) []*token.Token
- func TokenByPath(t *testing.T, tokens []*token.Token, dotPath string) *token.Token
- func UpdateGoldenFile(t *testing.T, goldenPath string, actual []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFixtureFile ¶
LoadFixtureFile reads a single fixture file and returns its content.
func NewFixtureFS ¶
NewFixtureFS loads fixture files from testdata and returns a MapFileSystem with files mapped to the specified root path.
func ParseFixtureTokens ¶ added in v0.2.0
func ParseFixtureTokens(t *testing.T, fixtureDir string, schemaVersion schema.Version) []*token.Token
ParseFixtureTokens loads a fixture file, parses tokens, and resolves aliases. The fixtureDir is relative to testdata/ (e.g., "fixtures/v2025-10-colors"). Returns the parsed and resolved tokens.
func TokenByPath ¶ added in v0.2.0
TokenByPath returns the first token matching the given dot-separated path (e.g., "color.oklch"). Fails the test if not found.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.