(t *testing.T)
| 384 | } |
| 385 | |
| 386 | func TestSelect(t *testing.T) { |
| 387 | fac := ast.NewExprFactory() |
| 388 | expr := fac.NewSelect(2, fac.NewIdent(1, "operand"), "field") |
| 389 | sel := expr.AsSelect() |
| 390 | if sel.FieldName() != "field" { |
| 391 | t.Errorf("sel.FieldName() got %s, wanted 'field'", sel.FieldName()) |
| 392 | } |
| 393 | if sel.Operand().AsIdent() != "operand" { |
| 394 | t.Errorf("sel.Operand().AsIdent() got %s, wanted 'operand'", sel.Operand().AsIdent()) |
| 395 | } |
| 396 | expr.RenumberIDs(testIDGen(20)) |
| 397 | if sel.Operand().ID() != 22 { |
| 398 | t.Errorf("Operand().ID() got %d, wanted 22", sel.Operand().ID()) |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | func TestSelectNil(t *testing.T) { |
| 403 | expr := nilTestExpr(t) |
nothing calls this directly
no test coverage detected