fixtureref

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package fixtureref validates qualified references to executable test fixtures. It is intended for test registries, not production code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(root string, refs []FixtureRef) error

Validate proves that every reference exists exactly once, with the declared kind, in the declared package/file. Go validation parses every _test.go file in the package, including files excluded by current build tags.

Types

type FixtureRef

type FixtureRef struct {
	Package  string
	File     string
	TestName string
	Kind     Kind
}

FixtureRef is an exact reference to an executable fixture. Package is a Go import path for Go fixtures and a repository-relative directory for Playwright. File is optional for Go and required for Playwright.

type Kind

type Kind string

Kind identifies the executable shape named by a fixture reference.

const (
	// KindTest names a top-level TestXxx function.
	KindTest Kind = "test"
	// KindBenchmark names a top-level BenchmarkXxx function.
	KindBenchmark Kind = "benchmark"
	// KindSubtest names a slash-qualified path of literal t.Run names below a test.
	KindSubtest Kind = "subtest"
	// KindHelper names a top-level, non-Test helper function in a _test.go file.
	KindHelper Kind = "helper"
	// KindPlaywrightTest names one executable static-title test in an exact spec file.
	KindPlaywrightTest Kind = "playwright-test"
)

Jump to

Keyboard shortcuts

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