(t *testing.T)
| 582 | } |
| 583 | |
| 584 | func TestGetMaxRelationalNodeID(t *testing.T) { |
| 585 | for _, tt := range []struct { |
| 586 | desc string |
| 587 | input *pb.QueryPlan |
| 588 | want int32 |
| 589 | }{ |
| 590 | { |
| 591 | desc: "pre-sorted order", |
| 592 | input: &pb.QueryPlan{ |
| 593 | PlanNodes: []*pb.PlanNode{ |
| 594 | {Index: 0, DisplayName: "Scalar Subquery", Kind: pb.PlanNode_SCALAR}, |
| 595 | {Index: 1, DisplayName: "Index Scan", Kind: pb.PlanNode_RELATIONAL}, |
| 596 | {Index: 2, DisplayName: "Index Scan", Kind: pb.PlanNode_RELATIONAL}, |
| 597 | {Index: 3, DisplayName: "Index Scan", Kind: pb.PlanNode_RELATIONAL}, |
| 598 | {Index: 4, DisplayName: "Constant", Kind: pb.PlanNode_SCALAR}, // This is not visible |
| 599 | }, |
| 600 | }, |
| 601 | want: 3, |
| 602 | }, |
| 603 | } { |
| 604 | if got := getMaxRelationalNodeID(tt.input); got != tt.want { |
| 605 | t.Errorf("getMaxRelationalNodeID(%s) = %d, but want = %d", tt.input, got, tt.want) |
| 606 | } |
| 607 | } |
| 608 | } |
nothing calls this directly
no test coverage detected