test

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatError

func FormatError(err error) string

func MustParse

func MustParse(options ...func(*ParserOptions)) *ast.File

func MustParseExpr

func MustParseExpr(options ...func(*ParserOptions)) ast.Expr

func MustParseTypeExpr

func MustParseTypeExpr(options ...func(*ParserOptions)) ast.TypeExpr

func NewParser

func NewParser(options ...func(*ParserOptions)) *parser.Parser

func Parse

func Parse(options ...func(*ParserOptions)) (*ast.File, error)

func ParseExpr

func ParseExpr(options ...func(*ParserOptions)) (ast.Expr, error)

func ParseTypeExpr

func ParseTypeExpr(options ...func(*ParserOptions)) (ast.TypeExpr, error)

func Run

func Run(t *testing.T, cases []Runner)

func RunWith

func RunWith[D any](t *testing.T, cases []Injector[D], dep D)

func WithFile

func WithFile(file *parser.File) func(*ParserOptions)

func WithName

func WithName(name string) func(*ParserOptions)

func WithSourceBytes

func WithSourceBytes(source []byte) func(*ParserOptions)

func WithSourceString

func WithSourceString(source string) func(*ParserOptions)

Types

type Injector

type Injector[D any] interface {
	Runner
	Inject(D)
}

type ParserOptions

type ParserOptions struct {
	File *parser.File
}

type Runner

type Runner interface {
	Run(*assert.Assertions)
}

Jump to

Keyboard shortcuts

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