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

Function TestMapFloat

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

Source from the content-addressed store, hash-verified

309}
310
311func TestMapFloat(t *testing.T) {
312 cfg := Node{
313 Children: []Node{
314 {
315 Name: "foo",
316 Args: []string{"1"},
317 },
318 },
319 }
320
321 m := NewMap(nil, cfg)
322
323 foo := 0.0
324 m.Float("foo", false, true, 0, &foo)
325
326 _, err := m.Process()
327 if err != nil {
328 t.Fatalf("Unexpected failure: %v", err)
329 }
330
331 if foo != 1.0 {
332 t.Errorf("Incorrect value stored in variable, want 1, got %v", foo)
333 }
334}
335
336func TestMapFloat_Invalid(t *testing.T) {
337 cfg := Node{

Callers

nothing calls this directly

Calls 3

FloatMethod · 0.95
ProcessMethod · 0.95
NewMapFunction · 0.85

Tested by

no test coverage detected