Codebase list golang-github-imdario-mergo / 8fbe67a4-cda9-44e9-9dd7-051ce783f180/main pr80_test.go
8fbe67a4-cda9-44e9-9dd7-051ce783f180/main

Tree @8fbe67a4-cda9-44e9-9dd7-051ce783f180/main (Download .tar.gz)

pr80_test.go @8fbe67a4-cda9-44e9-9dd7-051ce783f180/mainraw · history · blame

package mergo

import (
	"testing"
)

type mapInterface map[string]interface{}

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