MCPcopy Create free account
hub / github.com/goadesign/goa / TestParallelUpdates

Function TestParallelUpdates

codegen/testutil/example_test.go:74–85  ·  view source on GitHub ↗

Example: Parallel golden file updates

(t *testing.T)

Source from the content-addressed store, hash-verified

72
73// Example: Parallel golden file updates
74func TestParallelUpdates(t *testing.T) {
75 // When running with -update, files are updated in parallel by default
76 files := map[string]string{}
77 for i := 1; i <= 4; i++ {
78 files[fmt.Sprintf("parallel%d.golden", i)] = generateParallel(i)
79 }
80
81 for golden, actual := range files {
82 gf := testutil.NewGoldenFile(t, "testdata/golden")
83 gf.StringContent(actual).Path(golden).CompareContent()
84 }
85}
86
87// Helper functions for examples
88func generateServiceCode() string {

Callers

nothing calls this directly

Calls 5

StringContentMethod · 0.95
NewGoldenFileFunction · 0.92
generateParallelFunction · 0.85
CompareContentMethod · 0.80
PathMethod · 0.80

Tested by

no test coverage detected