Codebase list golang-github-imdario-mergo / bd63fc79-05f6-4175-a57a-a1e9f503f8a2/upstream issue61_test.go
bd63fc79-05f6-4175-a57a-a1e9f503f8a2/upstream

Tree @bd63fc79-05f6-4175-a57a-a1e9f503f8a2/upstream (Download .tar.gz)

issue61_test.go @bd63fc79-05f6-4175-a57a-a1e9f503f8a2/upstreamraw · history · blame

package mergo_test

import (
	"reflect"
	"testing"

	"github.com/imdario/mergo"
)

func TestIssue61MergeNilMap(t *testing.T) {
	type T struct {
		I map[string][]string
	}
	t1 := T{}
	t2 := T{I: map[string][]string{"hi": {"there"}}}

	if err := mergo.Merge(&t1, t2); err != nil {
		t.Fail()
	}

	if !reflect.DeepEqual(t2, T{I: map[string][]string{"hi": {"there"}}}) {
		t.FailNow()
	}
}