Config UI: add missing config sections / partial yaml inputs (BC) (#13319)
This commit is contained in:
parent
62a1e223b6
commit
554ce1db60
133 changed files with 4405 additions and 1572 deletions
18
util/encode/encode_test.go
Normal file
18
util/encode/encode_test.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package encode
|
||||
|
||||
import (
|
||||
"math"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestEncode(t *testing.T) {
|
||||
enc := NewEncoder(WithDuration())
|
||||
assert.Equal(t, nil, enc.Encode(time.Time{}))
|
||||
assert.Equal(t, nil, enc.Encode(math.NaN()))
|
||||
assert.Equal(t, nil, enc.Encode(math.Inf(0)))
|
||||
assert.Equal(t, 30, enc.Encode(30*time.Second))
|
||||
assert.Equal(t, 3.142, enc.Encode(math.Pi))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue