Documentation ¶
Index ¶
- Variables
- type TestContext
- func (t *TestContext) AssertBinaryImpl(op syntax.Token) ...
- func (t *TestContext) AssertFails(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (t *TestContext) Attr(name string) (starlark.Value, error)
- func (t *TestContext) AttrNames() []string
- func (t *TestContext) CallInternal(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
- func (t *TestContext) Freeze()
- func (t *TestContext) Hash() (uint32, error)
- func (t *TestContext) Name() string
- func (t *TestContext) String() string
- func (t *TestContext) Truth() starlark.Bool
- func (t *TestContext) Type() string
Constants ¶
This section is empty.
Variables ¶
View Source
var Fail = starlark.NewBuiltin("fail", failImpl)
Functions ¶
This section is empty.
Types ¶
type TestContext ¶
type TestContext struct { Attrs starlark.StringDict Failures []error }
TestContext is keeps track of whether there is a failure during a test execution
func AssertModule ¶
func AssertModule() *TestContext
AssertModule contains assertion functions. The *TestContext returned can be used to track assertion failures. assert.* functions from this module will mutate the *TestContext. After execution is complete, TestContext.Failures will be non-empty if any of the assertions failed, and also contain details about the failures.
func (*TestContext) AssertBinaryImpl ¶
func (t *TestContext) AssertBinaryImpl(op syntax.Token) func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
AssertBinaryImpl returns a function that implements comparing binary values in an assertion (i.e. assert_eq(1, 2))
func (*TestContext) AssertFails ¶
func (*TestContext) AttrNames ¶
func (t *TestContext) AttrNames() []string
func (*TestContext) CallInternal ¶
func (t *TestContext) CallInternal(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
CallInternal is the implementation for assert(...)
func (*TestContext) Freeze ¶
func (t *TestContext) Freeze()
func (*TestContext) Hash ¶
func (t *TestContext) Hash() (uint32, error)
func (*TestContext) Name ¶
func (t *TestContext) Name() string
func (*TestContext) String ¶
func (t *TestContext) String() string
func (*TestContext) Truth ¶
func (t *TestContext) Truth() starlark.Bool
func (*TestContext) Type ¶
func (t *TestContext) Type() string
Click to show internal directories.
Click to hide internal directories.