Codebase list golang-github-imdario-mergo / run/70a7923e-9f3d-41cc-9299-cc0b2bdef009/upstream pr80_test.go
run/70a7923e-9f3d-41cc-9299-cc0b2bdef009/upstream

Tree @run/70a7923e-9f3d-41cc-9299-cc0b2bdef009/upstream (Download .tar.gz)

pr80_test.go @run/70a7923e-9f3d-41cc-9299-cc0b2bdef009/upstreamraw · 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")
	}
}