testhelper

package
v0.0.0-...-ebc58a5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualExpr

func EqualExpr(t *testing.T, expected, actual node.Expr)

func EqualExprs

func EqualExprs(t *testing.T, expected, actual []node.Expr)

func EqualFuncType

func EqualFuncType(t *testing.T, expected, actual *node.FuncType)

func EqualIdents

func EqualIdents(t *testing.T, expected, actual []*node.Ident)

func EqualMapElements

func EqualMapElements(
	t *testing.T,
	expected, actual []*node.DictElementLit,
)

func EqualNamedArgs

func EqualNamedArgs(t *testing.T, expected, actual *node.NamedArgsList)

func EqualNamedArgsNames

func EqualNamedArgsNames(t *testing.T, expected, actual []node.NamedArgExpr)

func EqualStmt

func EqualStmt(t *testing.T, expected, actual node.Stmt)

func EqualStmts

func EqualStmts(t *testing.T, expected, actual []node.Stmt)

func EqualTypedIdents

func EqualTypedIdents(t *testing.T, expected, actual []*node.TypedIdent)

func ExpectParse

func ExpectParse(t *testing.T, input string, fn ExpectedFn, opt ...Option)

func ExpectParseError

func ExpectParseError(t *testing.T, input string, opt ...Option)

func ExpectParseString

func ExpectParseString(t *testing.T, input, expected string, opt ...Option)

func Parse

func Parse(t *testing.T, input string, do func(f *source.File, actual *parser.File, err error), opt ...Option)

func ParseTrace

func ParseTrace(t *testing.T, input, expected string)

Types

type ExpectedFn

type ExpectedFn func(pos Pfn) node.Stmts // callback function to return expected results

type Option

type Option func(po *parser.ParserOptions, so *parser.ScannerOptions)

type Pfn

type Pfn func(int, int) source.Pos // position conversion function

Jump to

Keyboard shortcuts

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