goldentest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package goldentest compares test output with committed golden files.

Regenerate goldens for one package with `go test ./sessions/<pkg> -update` and review the diff by hand: a refreshed golden is not proof of correctness.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Golden

func Golden(t *testing.T, path string, got any)

Golden marshals got as indented JSON and compares it byte-for-byte with the golden file at path, rewriting the file when -update is set.

func Text

func Text(t *testing.T, path, got string)

Text compares got with the golden file at path byte for byte, rewriting the file when -update is set. Use it for output a reviewer reads as text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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