luatesting

package
v0.0.0-...-e0b5347 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLines

func CheckLines(output []byte, checkers []LineChecker) error

func RunLuaTest

func RunLuaTest(source []byte, setup func(*rt.Runtime) func()) error

RunLuaTest runs the lua test code in source, running setup if non-nil beforehand (with the Runtime instance that will be used in the test).

func RunLuaTestFile

func RunLuaTestFile(t *testing.T, path string, setup func(*rt.Runtime) func())

func RunLuaTestsInDir

func RunLuaTestsInDir(t *testing.T, dirpath string, setup func(*rt.Runtime) func(), filters ...string)

RunLuaTestsInDir runs a test for each .lua file in the directory provided.

func RunSource

func RunSource(r *rt.Runtime, source []byte)

RunSource compiles and runs some source code, outputting to the provided io.Writer.

Types

type LineChecker

type LineChecker struct {
	SourceLineno int
	// contains filtered or unexported fields
}

func ExtractLineCheckers

func ExtractLineCheckers(source []byte) []LineChecker

type LiteralLineChecker

type LiteralLineChecker []byte

func (LiteralLineChecker) CheckLine

func (c LiteralLineChecker) CheckLine(output []byte) error

type RegexLineChecker

type RegexLineChecker regexp.Regexp

func (*RegexLineChecker) CheckLine

func (c *RegexLineChecker) CheckLine(output []byte) error

Jump to

Keyboard shortcuts

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