MCPcopy Create free account
hub / github.com/gavv/httpexpect / TestObject_Alias

Function TestObject_Alias

object_test.go:259–275  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

257}
258
259func TestObject_Alias(t *testing.T) {
260 reporter := newMockReporter(t)
261
262 value := NewObject(reporter, map[string]interface{}{
263 "foo": 100.0,
264 })
265 assert.Equal(t, []string{"Object()"}, value.chain.context.Path)
266 assert.Equal(t, []string{"Object()"}, value.chain.context.AliasedPath)
267
268 value.Alias("bar")
269 assert.Equal(t, []string{"Object()"}, value.chain.context.Path)
270 assert.Equal(t, []string{"bar"}, value.chain.context.AliasedPath)
271
272 childValue := value.Values()
273 assert.Equal(t, []string{"Object()", "Values()"}, childValue.chain.context.Path)
274 assert.Equal(t, []string{"bar", "Values()"}, childValue.chain.context.AliasedPath)
275}
276
277func TestObject_Path(t *testing.T) {
278 reporter := newMockReporter(t)

Callers

nothing calls this directly

Calls 5

AliasMethod · 0.95
ValuesMethod · 0.95
newMockReporterFunction · 0.85
NewObjectFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…