MCPcopy
hub / github.com/ddworken/hishtory / recordUsingGolden

Function recordUsingGolden

shared/testutils/testutils.go:369–379  ·  view source on GitHub ↗
(t testing.TB, goldenName string)

Source from the content-addressed store, hash-verified

367}
368
369func recordUsingGolden(t testing.TB, goldenName string) {
370 f, err := os.OpenFile("/tmp/goldens-used.txt",
371 os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
372 if err != nil {
373 t.Fatalf("failed to open file to record using golden: %v", err)
374 }
375 defer f.Close()
376 if _, err := f.WriteString(goldenName + "\n"); err != nil {
377 t.Fatalf("failed to append to file to record using golden: %v", err)
378 }
379}
380
381func CompareGoldens(t testing.TB, out, goldenName string) {
382 recordUsingGolden(t, goldenName)

Callers 1

CompareGoldensFunction · 0.85

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected