Codebase list golang-github-imdario-mergo / f15b2e0b-4b67-4946-bd79-c690bd5a4a87/upstream pr80_test.go
f15b2e0b-4b67-4946-bd79-c690bd5a4a87/upstream

Tree @f15b2e0b-4b67-4946-bd79-c690bd5a4a87/upstream (Download .tar.gz)

pr80_test.go @f15b2e0b-4b67-4946-bd79-c690bd5a4a87/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")
	}
}