fix: stabilize yutong mqtt ingestion
This commit is contained in:
@@ -75,6 +75,18 @@ func TestWriterSkipsSparseDerivedRows(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRawSizeBytesUsesRawTextWhenHexIsEmpty(t *testing.T) {
|
||||
env := envelope.FrameEnvelope{RawText: `{"code":"0F80","data":{"speed":12}}`}
|
||||
if got, want := rawSizeBytes(env), len([]byte(env.RawText)); got != want {
|
||||
t.Fatalf("raw text size = %d, want %d", got, want)
|
||||
}
|
||||
|
||||
env.RawHex = "7E0200"
|
||||
if got, want := rawSizeBytes(env), 3; got != want {
|
||||
t.Fatalf("raw hex size = %d, want %d", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func sampleEnvelope() envelope.FrameEnvelope {
|
||||
return envelope.FrameEnvelope{
|
||||
Protocol: envelope.ProtocolJT808,
|
||||
|
||||
Reference in New Issue
Block a user