support more proxy type

This commit is contained in:
fatedier
2017-03-10 02:01:17 +08:00
parent f90028cf96
commit b02e1007fb
14 changed files with 223 additions and 229 deletions

View File

@ -17,6 +17,7 @@ package msg
import (
"bytes"
"encoding/binary"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
@ -66,7 +67,7 @@ func TestUnPack(t *testing.T) {
// correct
msg, err = UnPack(TypePong, []byte("{}"))
assert.NoError(err)
assert.Equal(getTypeFn(msg), getTypeFn((*Pong)(nil)))
assert.Equal(reflect.TypeOf(msg).Elem(), reflect.TypeOf(Pong{}))
}
func TestUnPackInto(t *testing.T) {