Test for marshalling

This commit is contained in:
Jonathan Lange
2016-07-14 18:06:10 +01:00
parent 528936af4b
commit e4c75e6223

22
report/marshal_test.go Normal file
View 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)
}
}