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

Function TestArray_Alias

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

Source from the content-addressed store, hash-verified

222}
223
224func TestArray_Alias(t *testing.T) {
225 reporter := newMockReporter(t)
226
227 value := NewArray(reporter, []interface{}{1, 2})
228 assert.Equal(t, []string{"Array()"}, value.chain.context.Path)
229 assert.Equal(t, []string{"Array()"}, value.chain.context.AliasedPath)
230
231 value.Alias("foo")
232 assert.Equal(t, []string{"Array()"}, value.chain.context.Path)
233 assert.Equal(t, []string{"foo"}, value.chain.context.AliasedPath)
234
235 childValue := value.Filter(func(index int, value *Value) bool {
236 return value.Number().Raw() > 1
237 })
238 assert.Equal(t, []string{"Array()", "Filter()"}, childValue.chain.context.Path)
239 assert.Equal(t, []string{"foo", "Filter()"}, childValue.chain.context.AliasedPath)
240}
241
242func TestArray_Path(t *testing.T) {
243 cases := []struct {

Callers

nothing calls this directly

Calls 7

AliasMethod · 0.95
FilterMethod · 0.95
newMockReporterFunction · 0.85
NewArrayFunction · 0.85
EqualMethod · 0.45
RawMethod · 0.45
NumberMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…