(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestDefaultResolutionCache(t *testing.T) { |
| 13 | jsonSchema := MustLoadJSONSchemaDraft04() |
| 14 | swaggerSchema := MustLoadSwagger20Schema() |
| 15 | |
| 16 | cache := defaultResolutionCache() |
| 17 | |
| 18 | sch, ok := cache.Get("not there") |
| 19 | assert.FalseT(t, ok) |
| 20 | assert.Nil(t, sch) |
| 21 | |
| 22 | sch, ok = cache.Get("http://swagger.io/v2/schema.json") |
| 23 | assert.TrueT(t, ok) |
| 24 | assert.Equal(t, swaggerSchema, sch) |
| 25 | |
| 26 | sch, ok = cache.Get("http://json-schema.org/draft-04/schema") |
| 27 | assert.TrueT(t, ok) |
| 28 | assert.Equal(t, jsonSchema, sch) |
| 29 | |
| 30 | cache.Set("something", "here") |
| 31 | sch, ok = cache.Get("something") |
| 32 | assert.TrueT(t, ok) |
| 33 | assert.Equal(t, "here", sch) |
| 34 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…