Codebase list golang-github-imdario-mergo / upstream/0.3.12+git20210923.1.fd3dfc9 issue61_test.go
upstream/0.3.12+git20210923.1.fd3dfc9

Tree @upstream/0.3.12+git20210923.1.fd3dfc9 (Download .tar.gz)

issue61_test.go @upstream/0.3.12+git20210923.1.fd3dfc9

781f8d7
6720d30
 
 
 
781f8d7
 
6720d30
 
 
 
 
 
 
 
781f8d7
 
6720d30
 
781f8d7
6720d30
 
 
 
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()
	}
}