(t *testing.T)
| 194 | } |
| 195 | |
| 196 | func TestMapProcess_Duplicate(t *testing.T) { |
| 197 | cfg := Node{ |
| 198 | Children: []Node{ |
| 199 | { |
| 200 | Name: "foo", |
| 201 | Args: []string{"bar"}, |
| 202 | }, |
| 203 | { |
| 204 | Name: "foo", |
| 205 | Args: []string{"bar"}, |
| 206 | }, |
| 207 | }, |
| 208 | } |
| 209 | |
| 210 | m := NewMap(nil, cfg) |
| 211 | |
| 212 | foo := "" |
| 213 | m.Custom("foo", false, true, nil, func(_ *Map, n Node) (interface{}, error) { |
| 214 | return n.Args[0], nil |
| 215 | }, &foo) |
| 216 | |
| 217 | _, err := m.Process() |
| 218 | if err == nil { |
| 219 | t.Errorf("Expected failure") |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | func TestMapProcess_Unexpected(t *testing.T) { |
| 224 | cfg := Node{ |