testhelp

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: Zlib Imports: 8 Imported by: 0

Documentation

Overview

Helper functions for running scripts snippets in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t *testing.T, ok bool, msg ...interface{})

Assert fails the test and logs the message if "ok" is false.

This is purely a lazy convenience.

func AssertBlock

func AssertBlock(t *testing.T, l *lua.State, blk string, v interface{})

AssertBlock runs a block of Lua code. The test fails if there is an error or if "v" does not match the snippet's return value.

func AssertTyp

func AssertTyp(t *testing.T, l *lua.State, typ lua.TypeID, styp lua.STypeID, idx int)

AssertTyp checks that the value at the given index is a certain exact type.

func Assertf

func Assertf(t *testing.T, ok bool, format string, msg ...interface{})

Assertf fails the test and logs the message if "ok" is false.

This is purely a lazy convenience.

func MkState

func MkState() *lua.State

MkState creates a basic script state and populates it with most of the Lua standard library. The custom "string" module extensions are not installed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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