(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func 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 | } |
nothing calls this directly
no test coverage detected