assert

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

error(x) reports an error to the Go test framework.

func LoadAssertModule

func LoadAssertModule() (starlark.StringDict, error)

LoadAssertModule loads the assert module. It is concurrency-safe and idempotent.

func SetReporter

func SetReporter(thread *starlark.Thread, r Reporter)

SetReporter associates an error reporter (such as a testing.T in a Go test) with the Starlark thread so that Starlark programs may report errors to it.

Types

type Reporter

type Reporter interface {
	Error(err error)
	FailNow() bool
}

A Reporter is a value to which errors may be reported. It is satisfied by *testing.T.

func GetReporter

func GetReporter(thread *starlark.Thread) Reporter

GetReporter returns the Starlark thread's error reporter. It must be preceded by a call to SetReporter.

Jump to

Keyboard shortcuts

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