MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / TestGetMaxRelationalNodeID

Function TestGetMaxRelationalNodeID

query_plan_test.go:584–608  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

582}
583
584func 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}

Callers

nothing calls this directly

Calls 1

getMaxRelationalNodeIDFunction · 0.85

Tested by

no test coverage detected