Documentation ¶
Overview ¶
Package assert 重新封装assert函数,支持mysql、redis等校验 统一打印错误日志,用于报警显示
Index ¶
- func Contains(t *testing.T, exp, got interface{}, args ...interface{}) bool
- func ContainsOf(t *testing.T, exp, got interface{}, args ...interface{}) bool
- func ElementsMatch(t *testing.T, exp, got interface{}, args ...interface{}) bool
- func Empty(t *testing.T, got interface{}, args ...interface{}) bool
- func Equal(t *testing.T, exp, got interface{}, args ...interface{}) bool
- func EqualJson(t *testing.T, exp, got string) bool
- func EqualJsonByte(t *testing.T, exp, got []byte) bool
- func EqualJsonByteWithConsoleOutput(t *testing.T, exp, got []byte) bool
- func EqualJsonStrWithConsoleOutput(t *testing.T, exp, got string) bool
- func Error(t *testing.T, got error, args ...interface{}) bool
- func False(t *testing.T, got bool, args ...interface{}) bool
- func GetLastTestCasePositionFromCallerStack() (string, string)
- func Greater(t *testing.T, exp interface{}, got interface{}, args ...interface{}) bool
- func GreaterOrEqual(t *testing.T, exp interface{}, got interface{}, args ...interface{}) bool
- func HandleJsonNumber(data interface{}) (res interface{})
- func IsExist(t *testing.T, exp string, got map[string]interface{}, args ...interface{}) bool
- func JsonValidate(t *testing.T, scheam string, v interface{})
- func JsonValidateFromFile(t *testing.T, scheamFilePath string, v interface{}, args ...interface{}) bool
- func Less(t *testing.T, exp interface{}, got interface{}, args ...interface{}) bool
- func LessOrEqual(t *testing.T, exp interface{}, got interface{}, args ...interface{}) bool
- func Nil(t *testing.T, got interface{}, args ...interface{}) bool
- func NoError(t *testing.T, got error, args ...interface{}) bool
- func NotEmpty(t *testing.T, got interface{}, args ...interface{}) bool
- func NotEqual(t *testing.T, exp, got interface{}, args ...interface{}) bool
- func NotNil(t *testing.T, got interface{}, args ...interface{}) bool
- func True(t *testing.T, got bool, args ...interface{}) bool
- type Expect
- func (exp *Expect) Assert(t *testing.T, got interface{}, args ...interface{}) bool
- func (exp *Expect) AssertKey(t *testing.T) string
- func (exp *Expect) AssertObjFields(t *testing.T, result interface{}, args ...interface{}) bool
- func (exp *Expect) DetermineGot(got interface{}) (string, interface{})
- func (exp *Expect) InInterval(t *testing.T, result interface{}, args ...interface{}) bool
- type ExpectMultiMethod
- type ExpectSingleMethod
- type Interval
- type IntervalConf
- type IntervalRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsOf ¶
语义:实际结果包含配置value
func ElementsMatch ¶
func GreaterOrEqual ¶
func HandleJsonNumber ¶
func HandleJsonNumber(data interface{}) (res interface{})
func JsonValidate ¶
func JsonValidateFromFile ¶
func LessOrEqual ¶
Types ¶
type Expect ¶
type Expect struct { Method string `json:"method"` Value interface{} `json:"value"` Key string `json:"key"` SchemaPath string `json:"schema_path"` }
func (*Expect) AssertObjFields ¶
func (*Expect) DetermineGot ¶
type ExpectMultiMethod ¶
type ExpectSingleMethod ¶
type Interval ¶
type Interval struct { Left *IntervalConf `json:"left"` Right *IntervalConf `json:"right"` }
type IntervalConf ¶
type IntervalRule ¶
type IntervalRule string
const ( OpenInterval IntervalRule = "open" ClosedInterval IntervalRule = "closed" )
Click to show internal directories.
Click to hide internal directories.