(t *testing.T)
| 263 | } |
| 264 | |
| 265 | func 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 | |
| 290 | func TestMapInt_Invalid(t *testing.T) { |
| 291 | cfg := Node{ |