runners

package
v0.0.0-...-4349ab3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestParser

func NewTestParser(text *[]rune, origArgs ...interface{}) *parser.Parser

func NewTestProgramContext

func NewTestProgramContext(args ...interface{}) *parser.ProgramContext

func NewTestProgramParser

func NewTestProgramParser(text *[]rune, origArgs ...interface{}) *parser.ProgramParser

func NewTestUnitContext

func NewTestUnitContext(args ...interface{}) *parser.UnitContext

func NewTestUnitParser

func NewTestUnitParser(text *[]rune, origArgs ...interface{}) *parser.UnitParser

func RunBlockTest

func RunBlockTest(t *testing.T, name string, text []rune, expected *ast.Block, args ...interface{})

func RunProgramTest

func RunProgramTest(t *testing.T, name string, text []rune, expected *ast.Program, args ...interface{})

func RunStatementTest

func RunStatementTest(t *testing.T, name string, text []rune, expected *ast.Statement, args ...interface{})

func RunTypeSection

func RunTypeSection(t *testing.T, name string, text []rune, expected ast.TypeSection, args ...interface{})

func RunTypeTest

func RunTypeTest(t *testing.T, name string, text []rune, expected ast.Type, args ...interface{})

func RunUnitTest

func RunUnitTest(t *testing.T, name string, text []rune, expected *ast.Unit, args ...interface{})

func RunVarSectionTest

func RunVarSectionTest(t *testing.T, name string, text []rune, expected ast.VarSection, args ...interface{})

Types

type BaseTestRunner

type BaseTestRunner struct {
	T              *testing.T
	Name           string
	Text           *[]rune
	ClearLocations bool
	ParserArgFuncs ParserArgFuncs
}

func NewBaseTestRunner

func NewBaseTestRunner(
	t *testing.T,
	name string,
	text *[]rune,
	clearLocations bool,
	parserArgFuncs ParserArgFuncs,
	runnerFuncs BaseTestRunnerFuncs,
) *BaseTestRunner

func (*BaseTestRunner) NewParser

func (tt *BaseTestRunner) NewParser() *parser.Parser

func (*BaseTestRunner) Run

func (tt *BaseTestRunner) Run(
	parseFunc func() (astcore.Node, error),
	assertFunc func(t *testing.T, actual astcore.Node),
)

type BaseTestRunnerFunc

type BaseTestRunnerFunc = func(*BaseTestRunner)

type BaseTestRunnerFuncs

type BaseTestRunnerFuncs []BaseTestRunnerFunc

func FilterBaseTestRunnerFuncs

func FilterBaseTestRunnerFuncs(args []interface{}) (BaseTestRunnerFuncs, []interface{})

type BlockTestRunner

type BlockTestRunner struct {
	*BaseTestRunner
	Expected *ast.Block
}

func NewBlockTestRunner

func NewBlockTestRunner(t *testing.T, name string, text []rune, expected *ast.Block, args ...interface{}) *BlockTestRunner

func (*BlockTestRunner) Run

func (tt *BlockTestRunner) Run() *BlockTestRunner

type ParserArgFunc

type ParserArgFunc = func() interface{}

type ParserArgFuncs

type ParserArgFuncs []ParserArgFunc

func FilterParserArgFuncs

func FilterParserArgFuncs(args []interface{}) (ParserArgFuncs, []interface{})

func (ParserArgFuncs) Interfaces

func (s ParserArgFuncs) Interfaces() []interface{}

func (ParserArgFuncs) Results

func (s ParserArgFuncs) Results() []interface{}

type ProgramTestRunner

type ProgramTestRunner struct {
	*BaseTestRunner
	Expected *ast.Program
}

func NewProgramTestRunner

func NewProgramTestRunner(t *testing.T, name string, text []rune, expected *ast.Program, args ...interface{}) *ProgramTestRunner

func (*ProgramTestRunner) Run

type StatementTestRunner

type StatementTestRunner struct {
	*BaseTestRunner
	Expected *ast.Statement
}

func NewStatementTestRunner

func NewStatementTestRunner(t *testing.T, name string, text []rune, expected *ast.Statement, args ...interface{}) *StatementTestRunner

func (*StatementTestRunner) Run

type TypeSectionTestRunner

type TypeSectionTestRunner struct {
	*BaseTestRunner
	Expected ast.TypeSection
}

func NewTypeSectionTestRunner

func NewTypeSectionTestRunner(t *testing.T, name string, text []rune, expected ast.TypeSection, args ...interface{}) *TypeSectionTestRunner

func (*TypeSectionTestRunner) Run

type TypeTestRunner

type TypeTestRunner struct {
	*BaseTestRunner
	Expected ast.Type
}

func NewTypeTestRunner

func NewTypeTestRunner(t *testing.T, name string, text []rune, expected ast.Type, args ...interface{}) *TypeTestRunner

func (*TypeTestRunner) Run

func (tt *TypeTestRunner) Run() *TypeTestRunner

func (*TypeTestRunner) RunTypeSection

func (tt *TypeTestRunner) RunTypeSection(declName string) *TypeTestRunner

func (*TypeTestRunner) RunVarSection

func (tt *TypeTestRunner) RunVarSection(declName string) *TypeTestRunner

type UnitTestRunner

type UnitTestRunner struct {
	*BaseTestRunner
	Expected          *ast.Unit
	ClearUnitDeclMaps bool
}

func NewUnitTestRunner

func NewUnitTestRunner(t *testing.T, name string, text []rune, expected *ast.Unit, args ...interface{}) *UnitTestRunner

func (*UnitTestRunner) Run

func (tt *UnitTestRunner) Run() *UnitTestRunner

type UnitTestRunnerFunc

type UnitTestRunnerFunc = func(*UnitTestRunner)

type UnitTestRunnerFuncs

type UnitTestRunnerFuncs []UnitTestRunnerFunc

func FilterUnitTestRunnerFuncs

func FilterUnitTestRunnerFuncs(args []interface{}) (UnitTestRunnerFuncs, []interface{})

func (UnitTestRunnerFuncs) Call

func (s UnitTestRunnerFuncs) Call(tt *UnitTestRunner)

type VarSectionTestRunner

type VarSectionTestRunner struct {
	*BaseTestRunner
	Expected ast.VarSection
}

func NewVarSectionTestRunner

func NewVarSectionTestRunner(t *testing.T, name string, text []rune, expected ast.VarSection, args ...interface{}) *VarSectionTestRunner

func (*VarSectionTestRunner) Run

Jump to

Keyboard shortcuts

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