MCPcopy
hub / github.com/darccio/mergo / TestIssue149

Function TestIssue149

issue149_test.go:18–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16}
17
18func TestIssue149(t *testing.T) {
19 dest := &token{
20 User: &user{
21 Name: "destination",
22 },
23 Token: nil,
24 }
25 tokenValue := "Issue149"
26 src := &token{
27 User: nil,
28 Token: &tokenValue,
29 }
30 if err := mergo.Merge(dest, src, mergo.WithOverwriteWithEmptyValue); err != nil {
31 t.Error(err)
32 }
33 if dest.User != nil {
34 t.Errorf("expected nil User, got %q", dest.User)
35 }
36 if dest.Token == nil {
37 t.Errorf("expected not nil Token, got %q", *dest.Token)
38 }
39}

Callers

nothing calls this directly

Calls 1

MergeFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…