19 lines
342 B
Go
19 lines
342 B
Go
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package probe_test
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
"testing"
|
|
)
|
|
|
|
// minify compacts JSON to one line, like the probe prints it.
|
|
func minify(t *testing.T, raw []byte) []byte {
|
|
t.Helper()
|
|
var b bytes.Buffer
|
|
if err := json.Compact(&b, raw); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return b.Bytes()
|
|
}
|