(t *testing.T, schema *sourcedSchema, dataLoader gojsonschema.JSONLoader)
| 262 | } |
| 263 | |
| 264 | func 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 | } |
no test coverage detected