Add DeepCopy! Also-- optimize conversion for []byte

This commit is contained in:
Daniel Smith
2015-04-03 17:51:52 -07:00
parent 2bd95d4290
commit f591873af7
5 changed files with 171 additions and 2 deletions

View File

@@ -26,6 +26,19 @@ import (
"github.com/google/gofuzz"
)
func TestConverter_byteSlice(t *testing.T) {
c := NewConverter()
src := []byte{1, 2, 3}
dest := []byte{}
err := c.Convert(&src, &dest, 0, nil)
if err != nil {
t.Fatalf("expected no error")
}
if e, a := src, dest; !reflect.DeepEqual(e, a) {
t.Errorf("expected %#v, got %#v", e, a)
}
}
func TestConverter_DefaultConvert(t *testing.T) {
type A struct {
Foo string