evcc-io/server/mqtt_test.go
2022-12-24 11:24:13 +01:00

14 lines
290 B
Go

package server
import (
"math"
"testing"
"github.com/stretchr/testify/assert"
)
func TestMqttNaNInf(t *testing.T) {
m := &MQTT{}
assert.Equal(t, "NaN", m.encode(math.NaN()), "NaN not encoded as string")
assert.Equal(t, "+Inf", m.encode(math.Inf(0)), "Inf not encoded as string")
}