(t *testing.T)
| 513 | } |
| 514 | |
| 515 | func TestNavigableSelectExpr(t *testing.T) { |
| 516 | checked := mustTypeCheck(t, `msg.single_int32`) |
| 517 | expr := ast.NavigateAST(checked) |
| 518 | if expr.Kind() != ast.SelectKind { |
| 519 | t.Errorf("Kind() got %v, wanted SelectKind", expr.Kind()) |
| 520 | } |
| 521 | sel := expr.AsSelect() |
| 522 | if sel.FieldName() != "single_int32" { |
| 523 | t.Errorf("FieldName() got %s, wanted single_int32", sel.FieldName()) |
| 524 | } |
| 525 | if sel.Operand().Kind() != ast.IdentKind { |
| 526 | t.Fatalf("Operand() kind got %v, wanted ident", sel.Operand().Kind()) |
| 527 | } |
| 528 | if sel.Operand().AsIdent() != "msg" { |
| 529 | t.Errorf("Operand() got %v, wanted ident 'msg'", sel.Operand()) |
| 530 | } |
| 531 | if sel.IsTestOnly() { |
| 532 | t.Error("IsTestOnly() got true, wanted false") |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | func TestNavigableSelectExpr_TestOnly(t *testing.T) { |
| 537 | checked := mustTypeCheck(t, `has(msg.single_int32)`) |
nothing calls this directly
no test coverage detected