(t *testing.T)
| 590 | } |
| 591 | |
| 592 | func TestNavigableSelectExpr(t *testing.T) { |
| 593 | checked := mustTypeCheck(t, `msg.single_int32`) |
| 594 | expr := ast.NavigateAST(checked) |
| 595 | if expr.Kind() != ast.SelectKind { |
| 596 | t.Errorf("Kind() got %v, wanted SelectKind", expr.Kind()) |
| 597 | } |
| 598 | sel := expr.AsSelect() |
| 599 | if sel.FieldName() != "single_int32" { |
| 600 | t.Errorf("FieldName() got %s, wanted single_int32", sel.FieldName()) |
| 601 | } |
| 602 | if sel.Operand().Kind() != ast.IdentKind { |
| 603 | t.Fatalf("Operand() kind got %v, wanted ident", sel.Operand().Kind()) |
| 604 | } |
| 605 | if sel.Operand().AsIdent() != "msg" { |
| 606 | t.Errorf("Operand() got %v, wanted ident 'msg'", sel.Operand()) |
| 607 | } |
| 608 | if sel.IsTestOnly() { |
| 609 | t.Error("IsTestOnly() got true, wanted false") |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | func TestNavigableSelectExpr_TestOnly(t *testing.T) { |
| 614 | checked := mustTypeCheck(t, `has(msg.single_int32)`) |
nothing calls this directly
no test coverage detected