(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestArray_Schema(t *testing.T) { |
| 270 | cases := []struct { |
| 271 | name string |
| 272 | value []interface{} |
| 273 | }{ |
| 274 | { |
| 275 | name: "empty", |
| 276 | value: []interface{}{}, |
| 277 | }, |
| 278 | { |
| 279 | name: "not empty", |
| 280 | value: []interface{}{"foo", 123.0}, |
| 281 | }, |
| 282 | } |
| 283 | |
| 284 | for _, tc := range cases { |
| 285 | t.Run(tc.name, func(t *testing.T) { |
| 286 | reporter := newMockReporter(t) |
| 287 | |
| 288 | NewArray(reporter, tc.value).Schema(`{"type": "array"}`). |
| 289 | chain.assert(t, success) |
| 290 | |
| 291 | NewArray(reporter, tc.value).Schema(`{"type": "object"}`). |
| 292 | chain.assert(t, failure) |
| 293 | }) |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | func TestArray_Getters(t *testing.T) { |
| 298 | t.Run("length when empty", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…