14 lines
290 B
Go
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")
|
|
}
|