neoneo-go/pkg/network/payload/version_test.go

22 lines
310 B
Go
Raw Normal View History

2018-01-27 15:00:28 +00:00
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)
}
}