testutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package testutil provides testing utilities for asimonim.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFixtureFile

func LoadFixtureFile(t *testing.T, fixturePath string) []byte

LoadFixtureFile reads a single fixture file and returns its content.

func NewFixtureFS

func NewFixtureFS(t *testing.T, fixtureDir string, rootPath string) *mapfs.MapFileSystem

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

func TokenByPath(t *testing.T, tokens []*token.Token, dotPath string) *token.Token

TokenByPath returns the first token matching the given dot-separated path (e.g., "color.oklch"). Fails the test if not found.

func UpdateGoldenFile

func UpdateGoldenFile(t *testing.T, goldenPath string, actual []byte)

UpdateGoldenFile writes actual output to the golden file when -update flag is set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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