MCPcopy Index your code
hub / github.com/foxcpp/maddy / TestMapProcess_Duplicate

Function TestMapProcess_Duplicate

framework/config/map_test.go:196–221  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

194}
195
196func 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
223func TestMapProcess_Unexpected(t *testing.T) {
224 cfg := Node{

Callers

nothing calls this directly

Calls 3

CustomMethod · 0.95
ProcessMethod · 0.95
NewMapFunction · 0.85

Tested by

no test coverage detected