github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/sql/types/testutils.go (about)

     1  // Copyright 2021 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  package types
    12  
    13  // The following variables are useful for testing.
    14  var (
    15  	// OneIntCol is a slice of one IntType.
    16  	OneIntCol = []*T{Int}
    17  	// TwoIntCols is a slice of two IntTypes.
    18  	TwoIntCols = []*T{Int, Int}
    19  	// ThreeIntCols is a slice of three IntTypes.
    20  	ThreeIntCols = []*T{Int, Int, Int}
    21  	// FourIntCols is a slice of four IntTypes.
    22  	FourIntCols = []*T{Int, Int, Int, Int}
    23  )
    24  
    25  // MakeIntCols makes a slice of numCols IntTypes.
    26  func MakeIntCols(numCols int) []*T {
    27  	ret := make([]*T, numCols)
    28  	for i := 0; i < numCols; i++ {
    29  		ret[i] = Int
    30  	}
    31  	return ret
    32  }