MCPcopy Index your code
hub / github.com/gavv/httpexpect / TestArray_Schema

Function TestArray_Schema

array_test.go:269–295  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

267}
268
269func 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
297func TestArray_Getters(t *testing.T) {
298 t.Run("length when empty", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newMockReporterFunction · 0.85
NewArrayFunction · 0.85
assertMethod · 0.80
SchemaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…