Codebase list golang-github-imdario-mergo / e1fcb303-93b9-485d-b119-c5ef1c4f3e29/upstream/0.3.13+git20230126.1.6d2237a pr80_test.go
e1fcb303-93b9-485d-b119-c5ef1c4f3e29/upstream/0.3.13+git20230126.1.6d2237a

Tree @e1fcb303-93b9-485d-b119-c5ef1c4f3e29/upstream/0.3.13+git20230126.1.6d2237a (Download .tar.gz)

pr80_test.go @e1fcb303-93b9-485d-b119-c5ef1c4f3e29/upstream/0.3.13+git20230126.1.6d2237araw · history · blame

package mergo_test

import (
	"testing"

	"github.com/imdario/mergo"
)

type mapInterface map[string]interface{}

func TestMergeMapsEmptyString(t *testing.T) {
	a := mapInterface{"s": ""}
	b := mapInterface{"s": "foo"}
	if err := mergo.Merge(&a, b); err != nil {
		t.Error(err)
	}
	if a["s"] != "foo" {
		t.Errorf("b not merged in properly: a.s.Value(%s) != expected(%s)", a["s"], "foo")
	}
}