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