testutil

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testutil has helpers shared by tests.

Index

Constants

View Source
const UpdateEnv = "GOLDEN_UPDATE"

UpdateEnv makes golden helpers rewrite their files. mise run test:golden -- -update sets it.

Variables

This section is empty.

Functions

func Golden

func Golden(t *testing.T, path string, got []byte)

Golden compares got with the file at path, or rewrites the file when updating.

func Updating

func Updating() bool

Updating reports whether golden files should be rewritten.

Types

This section is empty.

Directories

Path Synopsis
Package fakebin turns the test binary into fake executables such as terragrunt or mise.
Package fakebin turns the test binary into fake executables such as terragrunt or mise.
Package ghtest has GitHub settings for cassette tests: the scrubber and the token to record with.
Package ghtest has GitHub settings for cassette tests: the scrubber and the token to record with.
Package mcptest connects an in-process MCP client to an mcpkit.Server and compares tool results with --format json golden files.
Package mcptest connects an in-process MCP client to an mcpkit.Server and compares tool results with --format json golden files.
Package sarifcheck validates SARIF logs against the SARIF 2.1.0 JSON schema that GitHub's upload-sarif action checks uploads with.
Package sarifcheck validates SARIF logs against the SARIF 2.1.0 JSON schema that GitHub's upload-sarif action checks uploads with.
Package vcr records HTTP interactions into go-vcr cassettes and replays them in tests.
Package vcr records HTTP interactions into go-vcr cassettes and replays them in tests.
Package vexcheck validates OpenVEX documents against the OpenVEX v0.2.0 JSON schema.
Package vexcheck validates OpenVEX documents against the OpenVEX v0.2.0 JSON schema.

Jump to

Keyboard shortcuts

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