asttest

package
v0.0.0-...-2bc12df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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) EAFTC

func (s *Suite) EAFTC(ast interface{}, falseVs ...plugin.Action)

EAFTC => EvalActionFalseTestCases

func (*Suite) EATTC

func (s *Suite) EATTC(ast interface{}, trueVs ...plugin.Action)

EATTC => EvalActionTrueTestCases

func (*Suite) EEFTC

func (s *Suite) EEFTC(ast interface{}, falseVs ...rql.Entry)

EEFTC => EvalEntryFalseTestCases

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) EETTC

func (s *Suite) EETTC(ast interface{}, trueVs ...rql.Entry)

EETTC => EvalEntryTrueTestCases

func (*Suite) ENFTC

func (s *Suite) ENFTC(ast interface{}, falseVs ...decimal.Decimal)

ENFTC => EvalNumericFalseTestCases

func (*Suite) ENTTC

func (s *Suite) ENTTC(ast interface{}, trueVs ...decimal.Decimal)

ENTTC => EvalNumericTrueTestCases

func (*Suite) ESFTC

func (s *Suite) ESFTC(ast interface{}, falseVs ...string)

ESFTC => EvalStringFalseTestCases

func (*Suite) ESTTC

func (s *Suite) ESTTC(ast interface{}, trueVs ...string)

ESTTC => EvalStringTrueTestCases

func (*Suite) ETFTC

func (s *Suite) ETFTC(ast interface{}, falseVs ...time.Time)

ETFTC => EvalTimeFalseTestCases

func (*Suite) ETTTC

func (s *Suite) ETTTC(ast interface{}, trueVs ...time.Time)

ETTTC => EvalTimeTrueTestCases

func (*Suite) EVFTC

func (s *Suite) EVFTC(ast interface{}, falseVs ...interface{})

EVFTC => EvalValueFalseTestCases

func (*Suite) EVSFTC

func (s *Suite) EVSFTC(ast interface{}, falseVs ...map[string]interface{})

EVSFTC => EvalValueSchemaFalseTestCases

func (*Suite) EVSTTC

func (s *Suite) EVSTTC(ast interface{}, trueVs ...map[string]interface{})

EVSTTC => EvalValueSchemaTrueTestCases

func (*Suite) EVTTC

func (s *Suite) EVTTC(ast interface{}, trueVs ...interface{})

EVTTC => EvalValueTrueTestCases

func (*Suite) MTC

func (s *Suite) MTC(n rql.ASTNode, expected interface{})

MTC => MarshalTestCase

func (*Suite) MUM

func (s *Suite) MUM(n rql.ASTNode, input interface{})

MUM => MustUnmarshal is a wrapper to ASTNode#Unmarshal. It will fail the test if unmarshaling fails

func (*Suite) N

func (s *Suite) N(n string) decimal.Decimal

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) SetupTest

func (s *Suite) SetupTest()

func (*Suite) TM

func (s *Suite) TM(t int64) time.Time

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

func (*Suite) UMETC

func (s *Suite) UMETC(ast interface{}, errRegex string, isMatchErr bool)

UMETC => UmarshalErrorTestCase

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL