wip refact 2

This commit is contained in:
anthdm 2018-01-27 16:00:28 +01:00
parent ccaaf07dad
commit 754a473488
9 changed files with 362 additions and 177 deletions

View file

@ -0,0 +1,21 @@
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)
}
}