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

Method Values

object.go:192–206  ·  view source on GitHub ↗

Values returns a new Array instance with object's values. Values are sorted by keys ascending order. Example: object := NewObject(t, map[string]interface{}{"foo": 123, "bar": 456}) object.Values().ContainsOnly(123, 456)

()

Source from the content-addressed store, hash-verified

190// object := NewObject(t, map[string]interface{}{"foo": 123, "bar": 456})
191// object.Values().ContainsOnly(123, 456)
192func (o *Object) Values() *Array {
193 opChain := o.chain.enter("Values()")
194 defer opChain.leave()
195
196 if opChain.failed() {
197 return newArray(opChain, nil)
198 }
199
200 values := []interface{}{}
201 for _, kv := range o.sortedKV() {
202 values = append(values, kv.val)
203 }
204
205 return newArray(opChain, values)
206}
207
208// Value returns a new Value instance with value for given key.
209//

Callers 2

TestObject_AliasFunction · 0.95
TestObject_GettersFunction · 0.95

Calls 5

sortedKVMethod · 0.95
newArrayFunction · 0.85
enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80

Tested by 2

TestObject_AliasFunction · 0.76
TestObject_GettersFunction · 0.76