Documentation ¶
Overview ¶
Package exprtest provides some useful test dummies to make it easier to mock expressions to return a desired result.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockExpression ¶
type MockExpression struct {
Eval func(*expr.Context, system.Collection) (system.Collection, error)
}
MockExpression is a test double expression that calls the contained function when evaluated.
func Error ¶
func Error(input error) *MockExpression
Error creates a MockExpression that returns the provided error when evaluated.
func Return ¶
func Return(out ...any) *MockExpression
Return creates a MockExpression that returns the provided inputs when evaluated.
func (*MockExpression) Evaluate ¶
func (e *MockExpression) Evaluate(ctx *expr.Context, input system.Collection) (system.Collection, error)
Evaluate calls the contained Eval function.
Click to show internal directories.
Click to hide internal directories.