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

Function TestIssue202

issue202_test.go:10–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestIssue202(t *testing.T) {
11 tests := []struct {
12 name string
13 dst, src, want map[string]interface{}
14 }{
15 {
16 name: "slice override string",
17 dst: map[string]interface{}{
18 "x": 456,
19 "y": "foo",
20 },
21 src: map[string]interface{}{
22 "x": "123",
23 "y": []int{1, 2, 3},
24 },
25 want: map[string]interface{}{
26 "x": "123",
27 "y": []int{1, 2, 3},
28 },
29 },
30 {
31 name: "string override slice",
32 dst: map[string]interface{}{
33 "x": 456,
34 "y": []int{1, 2, 3},
35 },
36 src: map[string]interface{}{
37 "x": "123",
38 "y": "foo",
39 },
40 want: map[string]interface{}{
41 "x": "123",
42 "y": "foo",
43 },
44 },
45 {
46 name: "map override string",
47 dst: map[string]interface{}{
48 "x": 456,
49 "y": "foo",
50 },
51 src: map[string]interface{}{
52 "x": "123",
53 "y": map[string]interface{}{
54 "a": true,
55 },
56 },
57 want: map[string]interface{}{
58 "x": "123",
59 "y": map[string]interface{}{
60 "a": true,
61 },
62 },
63 },
64 {
65 name: "string override map",
66 dst: map[string]interface{}{
67 "x": 456,

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…