Documentation ¶
Index ¶
- func Assert(msg string, outcome bool, reason string)
- func AssertEq(msg string, x any, y any)
- func AssertGt[T cmp.Ordered](msg string, x T, y T)
- func AssertGte[T cmp.Ordered](msg string, x T, y T)
- func AssertLt[T cmp.Ordered](msg string, x T, y T)
- func AssertLte[T cmp.Ordered](msg string, x T, y T)
- func AssertNe(msg string, x any, y any)
- func Call(funcName string, input []byte) pdk.Memory
- func CallBytes(funcName string, input []byte) []byte
- func CallString(funcName string, input []byte) string
- func Group(name string, tests func())
- func MockInput() pdk.Memory
- func MockInputBytes() []byte
- func MockInputString() string
- func Reset()
- func TimeNanos(funcName string, input []byte) uint64
- func TimeSeconds(funcName string, input []byte) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert that the `outcome` is true, naming the assertion with `msg`, which will be used as a label in the CLI runner.
func AssertEq ¶
Assert that `x` and `y` are equal, naming the assertion with `msg`, which will be used as a label in the CLI runner.
func AssertGt ¶
Assert that `x` is greater than `y`, naming the assertion with `msg`, which will be used as a label in the CLI runner.
func AssertGte ¶
Assert that `x` is greater than or equal to `y`, naming the assertion with `msg`, which will be used as a label in the CLI runner.
func AssertLt ¶
Assert that `x` is less than `y`, naming the assertion with `msg`, which will be used as a label in the CLI runner.
func AssertLte ¶
Assert that `x` is less than or equal to `y`, naming the assertion with `msg`, which will be used as a label in the CLI runner.
func AssertNe ¶
Assert that `x` and `y` are not equal, naming the assertion with `msg`, which will be used as a label in the CLI runner.
func Call ¶
Call a function from the Extism plugin being tested, passing input and returning its output Memory.
func CallBytes ¶
Call a function from the Extism plugin being tested, passing input and returning its output as []byte.
func CallString ¶
Call a function from the Extism plugin being tested, passing input and returning its output as a string.
func Group ¶
func Group(name string, tests func())
Run a test group, resetting the plugin before and after the group is run.
func MockInput ¶ added in v0.0.2
func MockInput() pdk.Memory
Read the mock test input provided by the test runner, returns a Memory object. This input is defined in an xtp.toml file, or by the --mock-input-data or --mock-input-file flags.
func MockInputBytes ¶ added in v0.0.2
func MockInputBytes() []byte
Read the mock test input provided by the test runner, returns the input as []byte. This input is defined in an xtp.toml file, or by the --mock-input-data or --mock-input-file flags.
func MockInputString ¶ added in v0.0.2
func MockInputString() string
Read the mock test input provided by the test runner, returns the input as a string. This input is defined in an xtp.toml file, or by the --mock-input-data or --mock-input-file flags.
func TimeNanos ¶
Call a function from the Extism plugin being tested, passing input and returning the time in nanoseconds spent in the fuction.
func TimeSeconds ¶
Call a function from the Extism plugin being tested, passing input and returning the time in seconds spent in the fuction.
Types ¶
This section is empty.