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

Function assertSchema

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

Source from the content-addressed store, hash-verified

262}
263
264func assertSchema(t *testing.T, schema *sourcedSchema, dataLoader gojsonschema.JSONLoader) {
265 res, err := schema.Validate(dataLoader)
266 if assert.Nil(t, err) {
267 if res.Valid() {
268 return
269 }
270
271 resErrors := res.Errors()
272 valErrors := make([]string, 0, len(resErrors))
273 for _, resErr := range resErrors {
274 valErrors = append(valErrors, resErr.String())
275 }
276 t.Errorf("Schema: %s\n%s", schema.Source, strings.Join(valErrors, "\n"))
277 }
278}

Callers 4

TestAPILockFunction · 0.70
TestAPIUnlockFunction · 0.70
TestAPISearchFunction · 0.70
TestAPISearchVerifiableFunction · 0.70

Calls 3

ErrorsMethod · 0.80
StringMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected