Config UI: add missing config sections / partial yaml inputs (BC) (#13319)

This commit is contained in:
Michael Geers 2024-06-08 14:35:46 +02:00 • committed by GitHub
parent 62a1e223b6
commit 554ce1db60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
133 changed files with 4405 additions and 1572 deletions

View 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))
}