github.com/whtcorpsinc/milevadb-prod@v0.0.0-20211104133533-f57f4be3b597/soliton/plancodec/id_test.go (about)

     1  // Copyright 2020 WHTCORPS INC, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package plancodec
    15  
    16  import (
    17  	"testing"
    18  
    19  	. "github.com/whtcorpsinc/check"
    20  )
    21  
    22  func TestT(t *testing.T) {
    23  	CustomVerboseFlag = true
    24  	TestingT(t)
    25  }
    26  
    27  var _ = Suite(&testCausetIDSuite{})
    28  
    29  type testCausetIDSuite struct{}
    30  
    31  func (s *testCausetIDSuite) TestCausetIDChanged(c *C) {
    32  	// Attention: for compatibility, shouldn't modify the below test, you can only add test when add new plan ID.
    33  	c.Assert(typeSelID, Equals, 1)
    34  	c.Assert(typeSetID, Equals, 2)
    35  	c.Assert(typeProjID, Equals, 3)
    36  	c.Assert(typeAggID, Equals, 4)
    37  	c.Assert(typeStreamAggID, Equals, 5)
    38  	c.Assert(typeHashAggID, Equals, 6)
    39  	c.Assert(typeShowID, Equals, 7)
    40  	c.Assert(typeJoinID, Equals, 8)
    41  	c.Assert(typeUnionID, Equals, 9)
    42  	c.Assert(typeBlockScanID, Equals, 10)
    43  	c.Assert(typeMemBlockScanID, Equals, 11)
    44  	c.Assert(typeUnionScanID, Equals, 12)
    45  	c.Assert(typeIdxScanID, Equals, 13)
    46  	c.Assert(typeSortID, Equals, 14)
    47  	c.Assert(typeTopNID, Equals, 15)
    48  	c.Assert(typeLimitID, Equals, 16)
    49  	c.Assert(typeHashJoinID, Equals, 17)
    50  	c.Assert(typeMergeJoinID, Equals, 18)
    51  	c.Assert(typeIndexJoinID, Equals, 19)
    52  	c.Assert(typeIndexMergeJoinID, Equals, 20)
    53  	c.Assert(typeIndexHashJoinID, Equals, 21)
    54  	c.Assert(typeApplyID, Equals, 22)
    55  	c.Assert(typeMaxOneRowID, Equals, 23)
    56  	c.Assert(typeExistsID, Equals, 24)
    57  	c.Assert(typeDualID, Equals, 25)
    58  	c.Assert(typeLockID, Equals, 26)
    59  	c.Assert(typeInsertID, Equals, 27)
    60  	c.Assert(typeUFIDelateID, Equals, 28)
    61  	c.Assert(typeDeleteID, Equals, 29)
    62  	c.Assert(typeIndexLookUpID, Equals, 30)
    63  	c.Assert(typeBlockReaderID, Equals, 31)
    64  	c.Assert(typeIndexReaderID, Equals, 32)
    65  	c.Assert(typeWindowID, Equals, 33)
    66  	c.Assert(typeEinsteinDBSingleGatherID, Equals, 34)
    67  	c.Assert(typeIndexMergeID, Equals, 35)
    68  	c.Assert(typePointGet, Equals, 36)
    69  	c.Assert(typeShowDBSJobs, Equals, 37)
    70  	c.Assert(typeBatchPointGet, Equals, 38)
    71  	c.Assert(typeClusterMemBlockReader, Equals, 39)
    72  	c.Assert(typeDataSourceID, Equals, 40)
    73  }