MCPcopy Create free account
hub / github.com/evcc-io/evcc / TestEncode

Function TestEncode

util/encode/encode_test.go:11–18  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestEncode(t *testing.T) {
12 enc := NewEncoder(WithDuration())
13 assert.Equal(t, nil, enc.Encode(time.Time{}))
14 assert.Equal(t, nil, enc.Encode(math.NaN()))
15 assert.Equal(t, nil, enc.Encode(math.Inf(0)))
16 assert.Equal(t, 30, enc.Encode(30*time.Second))
17 assert.Equal(t, 3.142, enc.Encode(math.Pi))
18}

Callers

nothing calls this directly

Calls 3

EncodeMethod · 0.95
NewEncoderFunction · 0.85
WithDurationFunction · 0.85

Tested by

no test coverage detected