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

Function TestMapInt

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

Source from the content-addressed store, hash-verified

263}
264
265func TestMapInt(t *testing.T) {
266 cfg := Node{
267 Children: []Node{
268 {
269 Name: "foo",
270 Args: []string{"1"},
271 },
272 },
273 }
274
275 m := NewMap(nil, cfg)
276
277 foo := 0
278 m.Int("foo", false, true, 0, &foo)
279
280 _, err := m.Process()
281 if err != nil {
282 t.Fatalf("Unexpected failure: %v", err)
283 }
284
285 if foo != 1 {
286 t.Errorf("Incorrect value stored in variable, want 1, got %d", foo)
287 }
288}
289
290func TestMapInt_Invalid(t *testing.T) {
291 cfg := Node{

Callers

nothing calls this directly

Calls 3

IntMethod · 0.95
ProcessMethod · 0.95
NewMapFunction · 0.85

Tested by

no test coverage detected