mergo/pr80_test.go
2025-04-03 16:24:13 +07:00

20 lines
394 B
Go

package mergo_test
import (
"testing"
"git.ct129.com/cmesh/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")
}
}