Documentation ¶
Index ¶
- Variables
- func CompareUnorderedStringSlice(a []string, b []string) bool
- func RowsWithSep(sep string, args ...string) [][]interface{}
- type TestData
- func (t *TestData) ConvertRowsToStrings(rows [][]interface{}) (rs []string)
- func (t *TestData) ConvertSQLWarnToStrings(warns []stmtctx.SQLWarn) (rs []string)
- func (t *TestData) GenerateOutputIfNeeded() error
- func (t *TestData) GetTestCases(c *check.C, in interface{}, out interface{})
- func (t *TestData) GetTestCasesByName(caseName string, c *check.C, in interface{}, out interface{})
- func (t *TestData) OnRecord(updateFunc func())
Constants ¶
This section is empty.
Variables ¶
var ConfigTestUtils configTestUtils
ConfigTestUtils contains a set of set-up/restore methods related to config used in tests.
var DatumEquals check.Checker = &datumEqualsChecker{ &check.CheckerInfo{Name: "DatumEquals", Params: []string{"obtained", "expected"}}, }
DatumEquals checker verifies that the obtained value is equal to the expected value. For example:
c.Assert(value, DatumEquals, NewDatum(42))
Functions ¶
func CompareUnorderedStringSlice ¶
CompareUnorderedStringSlice compare two string slices. If a and b is exactly the same except the order, it returns true. In otherwise return false.
func RowsWithSep ¶
RowsWithSep is a convenient function to wrap args to a slice of []interface. The arg represents a row, split by sep.
Types ¶
type TestData ¶
type TestData struct {
// contains filtered or unexported fields
}
TestData stores all the data of a test suite.
func LoadTestSuiteData ¶
LoadTestSuiteData loads test suite data from file.
func (*TestData) ConvertRowsToStrings ¶
ConvertRowsToStrings converts [][]interface{} to []string.
func (*TestData) ConvertSQLWarnToStrings ¶
ConvertSQLWarnToStrings converts []SQLWarn to []string.
func (*TestData) GenerateOutputIfNeeded ¶
GenerateOutputIfNeeded generate the output file.
func (*TestData) GetTestCases ¶
GetTestCases gets the test cases for a test function.
func (*TestData) GetTestCasesByName ¶
GetTestCasesByName gets the test cases for a test function by its name.