util_test.go 506 B

123456789101112131415
  1. package util
  2. import (
  3. "github.com/stretchr/testify/assert"
  4. "testing"
  5. )
  6. func TestMsgFormat(t *testing.T) {
  7. inptut := `SOFT_VER: 3 uuid: 8 frameid: 0 cowid: 99999999 csq: 10 Temp: 30.56 imei:869678048355757 active : 631 inactive: 0 Rumina: 76 Intake: 0 gasp: 0 other: 11 Remain: 0`
  8. output := `SOFT_VER:3 uuid:8 frameid:0 cowid:99999999 csq:10 Temp:30.56 imei:869678048355757 active:631 inactive:0 Rumina:76 Intake:0 gasp:0 other:11 Remain:0`
  9. res := MsgFormat(inptut)
  10. assert.Equal(t, output, res)
  11. }