1
0
Fork 0

feat: raw map parser.

This commit is contained in:
Fernandez Ludovic 2020-07-12 12:56:22 +02:00 committed by Traefiker Bot
parent 0186c31d59
commit c42f1b7a50
13 changed files with 901 additions and 18 deletions

View file

@ -755,6 +755,42 @@ func TestEncodeToNode(t *testing.T) {
}},
},
},
{
desc: "raw value",
element: struct {
Foo *struct {
Bar map[string]interface{}
}
}{
Foo: &struct {
Bar map[string]interface{}
}{
Bar: map[string]interface{}{
"AAA": "valueA",
"BBB": map[string]interface{}{
"CCC": map[string]interface{}{
"DDD": "valueD",
},
},
},
},
},
expected: expected{node: &Node{
Name: "traefik",
Children: []*Node{
{Name: "Foo", FieldName: "Foo", Children: []*Node{
{Name: "Bar", FieldName: "Bar", RawValue: map[string]interface{}{
"AAA": "valueA",
"BBB": map[string]interface{}{
"CCC": map[string]interface{}{
"DDD": "valueD",
},
},
}},
}},
},
}},
},
}
for _, test := range testCases {