mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Test for marshalling
This commit is contained in:
22
report/marshal_test.go
Normal file
22
report/marshal_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package report_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/weaveworks/scope/report"
|
||||
)
|
||||
|
||||
func TestRoundtrip(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
r1 := report.MakeReport()
|
||||
r1.WriteBinary(&buf)
|
||||
r2, err := report.MakeFromBinary(&buf)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if !reflect.DeepEqual(r1, *r2) {
|
||||
t.Errorf("%v != %v", r1, *r2)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user