moduletest

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExprTests

func ExprTests(t *testing.T, globals starlark.StringDict, tt []*ExprTest, options ...ExprTestOption)

Types

type ExecFileTest

type ExecFileTest struct {
	Source  string
	Env     map[string]string
	WantErr string
	Want    string
}

func (*ExecFileTest) Run

func (tc *ExecFileTest) Run(t *testing.T, files *protoregistry.Files, globals starlark.StringDict)

type ExecFileTests

type ExecFileTests map[string]*ExecFileTest

func (ExecFileTests) Run

func (tt ExecFileTests) Run(t *testing.T, files *protoregistry.Files, globals starlark.StringDict)

type ExprTest

type ExprTest struct {
	Expr        string            // Input expression
	Env         map[string]string // Optional env vars
	WantErr     string            // Optional expected error
	WantElapsed time.Duration     // Optional expected min test time
	WantPrinted string            // Optional output of 'print'
	Want        string
	Before      func(t *testing.T, globals starlark.StringDict) starlark.StringDict // Optional function to run at the end
	After       func(t *testing.T, value starlark.Value)                            // Optional function to run at the end
}

func (*ExprTest) Run

func (tc *ExprTest) Run(t *testing.T, globals starlark.StringDict)

type ExprTestOption

type ExprTestOption func(*ExprTest)

Jump to

Keyboard shortcuts

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