Package list golang-github-imdario-mergo / bd63fc79-05f6-4175-a57a-a1e9f503f8a2/main pr80_test.go
bd63fc79-05f6-4175-a57a-a1e9f503f8a2/main

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

pr80_test.go @bd63fc79-05f6-4175-a57a-a1e9f503f8a2/mainraw · 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")
	}
}