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: ? 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 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