(t *testing.T)
| 381 | } |
| 382 | |
| 383 | func TestMaxID(t *testing.T) { |
| 384 | checked := mustTypeCheck(t, `has({'a':'key'}.key)`) |
| 385 | maxID := ast.MaxID(checked) |
| 386 | checked.SourceInfo().SetMacroCall( |
| 387 | maxID+2, |
| 388 | ast.NewExprFactory().NewIdent(maxID+1, "dummy")) |
| 389 | // Max ID always pads by 1 between invocations, and it's called twice here |
| 390 | // due to the presence of the macro which was injected after the fact. |
| 391 | if ast.MaxID(checked) != maxID+4 { |
| 392 | t.Errorf("ast.MaxID() got %v, wanted %d", ast.MaxID(checked), maxID+4) |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | func TestHeights(t *testing.T) { |
| 397 | tests := []struct { |
nothing calls this directly
no test coverage detected