Documentation ¶
Index ¶
- type InterfaceCode
- type Suite
- func (s *Suite) A(vs ...interface{}) []interface{}
- func (s *Suite) AssertNotImplemented(ast interface{}, interfaceCs ...InterfaceCode)
- func (s *Suite) EAFTC(ast interface{}, falseVs ...plugin.Action)
- func (s *Suite) EATTC(ast interface{}, trueVs ...plugin.Action)
- func (s *Suite) EEFTC(ast interface{}, falseVs ...rql.Entry)
- func (s *Suite) EESFTC(ast interface{}, falseVs ...*rql.EntrySchema)
- func (s *Suite) EESTTC(ast interface{}, trueVs ...*rql.EntrySchema)
- func (s *Suite) EETTC(ast interface{}, trueVs ...rql.Entry)
- func (s *Suite) ENFTC(ast interface{}, falseVs ...decimal.Decimal)
- func (s *Suite) ENTTC(ast interface{}, trueVs ...decimal.Decimal)
- func (s *Suite) ESFTC(ast interface{}, falseVs ...string)
- func (s *Suite) ESTTC(ast interface{}, trueVs ...string)
- func (s *Suite) ETFTC(ast interface{}, falseVs ...time.Time)
- func (s *Suite) ETTTC(ast interface{}, trueVs ...time.Time)
- func (s *Suite) EVFTC(ast interface{}, falseVs ...interface{})
- func (s *Suite) EVSFTC(ast interface{}, falseVs ...map[string]interface{})
- func (s *Suite) EVSTTC(ast interface{}, trueVs ...map[string]interface{})
- func (s *Suite) EVTTC(ast interface{}, trueVs ...interface{})
- func (s *Suite) MTC(n rql.ASTNode, expected interface{})
- func (s *Suite) MUM(n rql.ASTNode, input interface{})
- func (s *Suite) N(n string) decimal.Decimal
- func (s *Suite) SetupTest()
- func (s *Suite) TM(t int64) time.Time
- func (s *Suite) ToJSONSchemas(schemas ...map[string]interface{}) []*plugin.JSONSchema
- func (s *Suite) UMETC(ast interface{}, errRegex string, isMatchErr bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterfaceCode ¶
type InterfaceCode int8
const ( PrimaryC InterfaceCode = iota EntryPredicateC EntrySchemaPredicateC ValuePredicateC StringPredicateC NumericPredicateC TimePredicateC ActionPredicateC )
Here, C => Code. So EntryPredicateC => EntryPredicateCode
type Suite ¶
type Suite struct { suite.Suite DefaultNodeConstructor func() rql.ASTNode NodeConstructor func() rql.ASTNode }
Suite represents a type that tests RQL AST nodes. NodeConstructor represents the AST node constructor that returns an empty AST node object. It can be overridden by each test. DefaultNodeConstructor represents the default node constructor that will be set for each test before they run. It should be initialized when the suite class is created.
func (*Suite) A ¶
func (s *Suite) A(vs ...interface{}) []interface{}
A ("Array") is a helper meant to make []interface{} input specs more readable. For example, instead of []interface{"foo", "bar", "baz"}, you can use s.A("foo", "bar", "baz")
func (*Suite) AssertNotImplemented ¶
func (s *Suite) AssertNotImplemented(ast interface{}, interfaceCs ...InterfaceCode)
func (*Suite) EESFTC ¶
func (s *Suite) EESFTC(ast interface{}, falseVs ...*rql.EntrySchema)
EESFTC => EvalEntrySchemaFalseTestCases
func (*Suite) EESTTC ¶
func (s *Suite) EESTTC(ast interface{}, trueVs ...*rql.EntrySchema)
EESTTC => EvalEntrySchemaTrueTestCases
func (*Suite) EVFTC ¶
func (s *Suite) EVFTC(ast interface{}, falseVs ...interface{})
EVFTC => EvalValueFalseTestCases
func (*Suite) EVTTC ¶
func (s *Suite) EVTTC(ast interface{}, trueVs ...interface{})
EVTTC => EvalValueTrueTestCases
func (*Suite) MUM ¶
MUM => MustUnmarshal is a wrapper to ASTNode#Unmarshal. It will fail the test if unmarshaling fails
func (*Suite) N ¶
N ("Number") is a helper meant to make decimal.NewFromString input specs more readable. For example, instead of decimal.NewFromString("3"), you can use s.N("3").
func (*Suite) TM ¶
TM ("Time") is a helper meant to make time.Unix input specs more readable. For example, instead of time.Unix(1000, 0), you can use s.T(1000).
func (*Suite) ToJSONSchemas ¶
func (s *Suite) ToJSONSchemas(schemas ...map[string]interface{}) []*plugin.JSONSchema