test

package
v0.296.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForeachLeaf

func ForeachLeaf(val rel.Value, path string, leafAction func(val rel.Value, path string))

ForeachLeaf visits all leaves in an test tree, invoking the leafAction callback for each leaf encountered. Tuples, arrays and dictionaries are considered test containers and not leaves, they are recursed into.

func Report

func Report(w io.Writer, testFiles []File) error

Report writes a formatted output of all the test files and their test results, and returns and error if the test run failed.

func RunTests

func RunTests(ctx context.Context, w io.Writer, path string) error

RunTests runs all arr.ai tests in a given path. It returns an error if the path is invalid, contains no test files or has invalid arr.ai code in any of them.

Types

type File

type File struct {
	Path     string
	Source   string
	WallTime time.Duration
	Results  []Result
}

type Outcome

type Outcome int
const (
	Failed Outcome = iota
	Invalid
	Ignored
	Passed
)

type Result

type Result struct {
	Name    string
	Outcome Outcome
	Message string
}

func RunExpr

func RunExpr(ctx context.Context, expr rel.Expr) ([]Result, error)

RunExpr runs all tests in the provided rel.Expr and returns a slice of Result. It returns an error if the arr.ai code failed to evaluate.

Jump to

Keyboard shortcuts

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