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

Function AssertString

codegen/testutil/golden.go:269–273  ·  view source on GitHub ↗

AssertString provides a simple assertion API for strings

(t testing.TB, goldenPath string, got string)

Source from the content-addressed store, hash-verified

267
268// AssertString provides a simple assertion API for strings
269func AssertString(t testing.TB, goldenPath string, got string) {
270 t.Helper()
271 gf := &GoldenFile{t: t, basePath: ""}
272 gf.StringContent(got).Path(goldenPath).CompareContent()
273}
274
275// AssertJSON compares JSON content with proper formatting
276func AssertJSON(t testing.TB, goldenPath string, got []byte) {

Callers 8

TestWebSocketGoldenFilesFunction · 0.92
TestSectionsFunction · 0.92
TestValidationsFunction · 0.92
TestExtensionsFunction · 0.92
TestFilesFunction · 0.92
TestProtoFilesFunction · 0.92
TestMessageDefSectionFunction · 0.92
TestBasicUsageFunction · 0.92

Calls 3

StringContentMethod · 0.95
CompareContentMethod · 0.80
PathMethod · 0.80

Tested by 8

TestWebSocketGoldenFilesFunction · 0.74
TestSectionsFunction · 0.74
TestValidationsFunction · 0.74
TestExtensionsFunction · 0.74
TestFilesFunction · 0.74
TestProtoFilesFunction · 0.74
TestMessageDefSectionFunction · 0.74
TestBasicUsageFunction · 0.74