testutils

package
v0.0.0-...-22a4c2b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTestRun

func IsTestRun() bool

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader) (*TestOutput, error)

func (*Parser) ParseInputExpected

func (p *Parser) ParseInputExpected(filename string, input string) (*TestOutput, *TestOutput, error)

func (*Parser) Scan

func (p *Parser) Scan() token

type SetupTestConfig

type SetupTestConfig struct {
	DirName        string
	TemplateLoader func(*lib.ErrorTemplates)
}

type TestCase

type TestCase struct {
	Name             string
	Input            string
	ExpectedLanguage string
	ExpectedTemplate string
	ExpectedOutput   string
	Files            fstest.MapFS
}

type TestCases

type TestCases struct {
	// contains filtered or unexported fields
}

func SetupTest

func SetupTest(tb testing.TB, cfg SetupTestConfig) TestCases

func (TestCases) Execute

func (cases TestCases) Execute(t *testing.T)

type TestOutput

type TestOutput struct {
	Name     string
	Language string
	Template string
	Output   string
}

Jump to

Keyboard shortcuts

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