MCPcopy
hub / github.com/aws/aws-lambda-go / TestUnmarshalFloat

Function TestUnmarshalFloat

events/attributevalue_test.go:108–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestUnmarshalFloat(t *testing.T) {
109 input := []byte(`{ "N": "123.45"}`)
110
111 var av DynamoDBAttributeValue
112 err := json.Unmarshal(input, &av)
113 assert.Nil(t, err)
114
115 var f float64
116 f, err = av.Float()
117
118 assert.Nil(t, err)
119 assert.Equal(t, 123.45, f)
120}
121
122func TestUnmarshalIntContainingAFloatString(t *testing.T) {
123 input := []byte(`{ "N": "123.45"}`)

Callers

nothing calls this directly

Calls 1

FloatMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…