(t *testing.T)
| 309 | } |
| 310 | |
| 311 | func 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 | |
| 336 | func TestMapFloat_Invalid(t *testing.T) { |
| 337 | cfg := Node{ |