testutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package testutil provides test-only helpers shared across packages. It is a function-only library with no global state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(t *testing.T, name string) []byte

Load reads testdata/<name> by walking up from the current package directory looking for a "testdata" sibling. It fails the test if the file (or the testdata directory) cannot be located.

The walk-up strategy lets test files in any subpackage share a single repo-root testdata/ tree without duplicating fixture files.

func Path

func Path(t *testing.T, name string) string

Path returns the absolute path to testdata/<name> using the same walk-up strategy as Load. It fails the test if the fixture cannot be located. Used by callers that need a file path (e.g. reader.Open) rather than the bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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