neoneo-go/pkg/network/payload/version_test.go
2018-01-27 16:00:28 +01:00

21 lines
310 B
Go

package payload
import (
"bytes"
"reflect"
"testing"
)
func TestVersionEncodeDecode(t *testing.T) {
p := NewVersion(3000, "/NEO/", 0, true)
buf := new(bytes.Buffer)
p.Encode(buf)
pd := &Version{}
pd.Decode(buf)
if !reflect.DeepEqual(p, pd) {
t.Fatalf("expect %v to be equal to %v", p, pd)
}
}