VictoriaMetrics/lib/protoparser/firehose/parser_test.go

17 lines
353 B
Go
Raw Normal View History

package firehose
import (
"testing"
)
func TestProcessRequestBody(t *testing.T) {
data := []byte(`{"records": [{"data": "SGVsbG8sIA=="}, {"data": "d29ybGQh"}]}`)
err := ProcessRequestBody(&data)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if string(data) != "Hello, world!" {
t.Fatalf("unexpected string: %q", string(data))
}
}