Documentation ¶
Index ¶
- Constants
- Variables
- func AlmostEqual(a, b float64) bool
- func CheckResult(testDataSource TestDataSource, expected *ResultTable, answer []*scql.Tensor, ...) (err error)
- func FillTableToPartyCodeMap(dbTables map[string][]*model.TableInfo)
- func IsColumnNil(col *ResultColumn) bool
- type QueryCase
- type QueryTestSuit
- type ResultColumn
- type ResultTable
- type StringWithId
- type StringWithIds
- type TestDataSource
Constants ¶
View Source
const (
NumericalPrecision float64 = 1e-1
)
NumericalPrecision is based on experiment
Variables ¶
View Source
var (
TableToPartyCode map[string]string
)
Functions ¶
func AlmostEqual ¶
func CheckResult ¶
func CheckResult(testDataSource TestDataSource, expected *ResultTable, answer []*scql.Tensor, mysqlQueryString, errInfo string) (err error)
func FillTableToPartyCodeMap ¶
func IsColumnNil ¶
func IsColumnNil(col *ResultColumn) bool
Types ¶
type QueryCase ¶
type QueryCase struct { Name string `json:"name"` View []string `json:"view"` Query string `json:"query"` MySQLQuery string `json:"mysql_query"` Result *ResultTable `json:"result"` }
type QueryTestSuit ¶
type QueryTestSuit struct {
Queries []QueryCase
}
type ResultColumn ¶
type ResultColumn struct { Name string `json:"name"` Ss []string `json:"string"` Int64s []int64 `json:"int"` Bools []bool `json:"bool"` Doubles []float64 `json:"float"` }
func (*ResultColumn) ChangeOrders ¶
func (c *ResultColumn) ChangeOrders(orders []int)
func (*ResultColumn) EqualTo ¶
func (c *ResultColumn) EqualTo(o *ResultColumn) bool
type ResultTable ¶
type ResultTable struct {
Column []*ResultColumn `json:"column"`
}
func (*ResultTable) ConvertToRows ¶
func (t *ResultTable) ConvertToRows() StringWithIds
func (*ResultTable) EqualTo ¶
func (t *ResultTable) EqualTo(o *ResultTable) bool
type StringWithId ¶
type StringWithId struct {
// contains filtered or unexported fields
}
type StringWithIds ¶
type StringWithIds []StringWithId
func (StringWithIds) GetOrders ¶
func (x StringWithIds) GetOrders() []int
func (StringWithIds) Len ¶
func (x StringWithIds) Len() int
func (StringWithIds) Less ¶
func (x StringWithIds) Less(i, j int) bool
func (StringWithIds) Swap ¶
func (x StringWithIds) Swap(i, j int)
type TestDataSource ¶
func (*TestDataSource) ConnDB ¶
func (ds *TestDataSource) ConnDB(conf *config.StorageConf) (err error)
connDB creates a connection to the MySQL instance
func (*TestDataSource) GetQueryResultFromMySQL ¶
func (ds *TestDataSource) GetQueryResultFromMySQL(query string, needConvertDateTime bool) (curCaseResult *ResultTable, err error)
func (*TestDataSource) TruncateTable ¶
func (ds *TestDataSource) TruncateTable(tableName string) error
Truncate table
Click to show internal directories.
Click to hide internal directories.