require

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t *testing.T, expected, actual interface{}, msg ...interface{})

Equal asserts expected and actual are equal.

func Error

func Error(t *testing.T, err error, msg ...interface{})

Error asserts err is an error.

func Expect

func Expect(t *testing.T, input string, expected interface{})

Expect runs the input script and asserts that the value of "out" is equal to expected.

func Fail

func Fail(t *testing.T, msg ...interface{})

Fail marks the function as having failed but continues execution.

func False

func False(t *testing.T, v bool, msg ...interface{})

False asserts vis false.

func IsType

func IsType(
	t *testing.T,
	expected, actual interface{},
	msg ...interface{},
)

IsType asserts expected and actual are of the same type.

func Nil

func Nil(t *testing.T, v interface{}, msg ...interface{})

Nil asserts v is nil.

func NoError

func NoError(t *testing.T, err error, msg ...interface{})

NoError asserts err is not an error.

func NotNil

func NotNil(t *testing.T, v interface{}, msg ...interface{})

NotNil asserts v is not nil.

func Object

func Object(v interface{}) vm.Object

Object converts a Go value to a vm.Object for comparison in tests.

func True

func True(t *testing.T, v bool, msg ...interface{})

True asserts v is true.

Types

type ARR

type ARR = []interface{}

ARR -

type CallRes

type CallRes struct {
	T *testing.T
	O interface{}
	E error
}

CallRes is a helper struct for chaining calls to module functions and asserting results.

func Module

func Module(t *testing.T, moduleName string) CallRes

Module loads a module and returns it as a CallRes for chaining calls.

func (CallRes) Call

func (c CallRes) Call(funcName string, args ...interface{}) CallRes

Call calls a function on the result of a previous call and returns a new CallRes for chaining.

func (CallRes) Expect

func (c CallRes) Expect(expected interface{}, msgAndArgs ...interface{})

Expect asserts that the result of the previous call is equal to expected and that no error occurred.

func (CallRes) ExpectError

func (c CallRes) ExpectError()

ExpectError asserts that the previous call resulted in an error.

func (CallRes) ExpectNoError

func (c CallRes) ExpectNoError()

ExpectNoError asserts that the previous call did not result in an error.

type IARR

type IARR []interface{}

IARR -

type IMAP

type IMAP map[string]interface{}

IMAP -

type MAP

type MAP = map[string]interface{}

MAP -

Jump to

Keyboard shortcuts

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