goldentest

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package goldentest is a utility to help create tests that compare a result (e.g. serialized data or formatted text) against a golden file stored in testdata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(t *testing.T, goldenPath, actual string)

Check looks for a file at testdata/{t.Name()}/[goldenPath], compares [actual] against the content, and causes the test to fail if it's incorrect. If "-update" or "-args update" is passed to the "go test" command, instead of failing, writes [actual] to the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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