MCPcopy
hub / github.com/git-lfs/git-lfs / assertSchema

Function assertSchema

tq/api_test.go:175–189  ·  view source on GitHub ↗
(t *testing.T, schema *sourcedSchema, dataLoader gojsonschema.JSONLoader)

Source from the content-addressed store, hash-verified

173}
174
175func assertSchema(t *testing.T, schema *sourcedSchema, dataLoader gojsonschema.JSONLoader) {
176 res, err := schema.Validate(dataLoader)
177 if assert.Nil(t, err) {
178 if res.Valid() {
179 return
180 }
181
182 resErrors := res.Errors()
183 valErrors := make([]string, 0, len(resErrors))
184 for _, resErr := range resErrors {
185 valErrors = append(valErrors, resErr.String())
186 }
187 t.Errorf("Schema: %s\n%s", schema.Source, strings.Join(valErrors, "\n"))
188 }
189}

Callers 2

TestAPIBatchFunction · 0.70
TestAPIBatchOnlyBasicFunction · 0.70

Calls 3

ErrorsMethod · 0.80
StringMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected