Registry / testing / xorcare-golden

xorcare-golden

JSON →
library0.8.4gogounverified

Golden file testing for Go, allowing easy update of test expectations via -update flag.

go get github.com/xorcare/golden
INSTALL
IMPORT
SIG · XORCARE-GOLDEN
X
xorcare-golden
testinggov0.8.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

golden
github.com/xorcare/golden

Use golden.Assert in a test to compare output with a golden file.

package main import ( "testing" "github.com/xorcare/golden" ) func TestSomething(t *testing.T) { got := "expected output" golden.Assert(t, []byte(got)) }
Debug
Known issues
gotchaGolden files are stored in testdata directory; ensure they are committed to version control.
fix
Run tests with -update flag to regenerate golden files when output changes intentionally.
affects: >=0.1.0
Upgrade
Version history
0.8.4latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
18
Resources
xorcare-golden — go get xorcare-golden · libregistry