slicetest

package
v0.0.0-...-30c4c12 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package slicetest provides utilities for testing Bigslice user code. The utilities here are generally not optimized for performance or robustness; they are strictly intended for unit testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(slice bigslice.Slice)

Print prints slice to stdout in a deterministic order. This is useful for use in slice function examples, as we can rely on the deterministic order in our expected output. Print uses local evaluation, so all user functions are executed within the same process. This makes it safe and convenient to use shared memory in slice operations.

func Run

func Run(t *testing.T, slice bigslice.Slice) *sliceio.Scanner

Run evaluates the provided slice in local execution mode, returning a scanner for the result. Errors are reported as fatal to the provided t instance. Run is intended for unit testing of Slice implementations.

func RunAndScan

func RunAndScan(t *testing.T, slice bigslice.Slice, cols ...interface{})

RunAndScan evaluates the provided slice and scans its results into the provided slice pointers. Errors are reported as fatal to the provided t instance.

func RunErr

func RunErr(slice bigslice.Slice) error

RunErr evaluates the provided slice in local execution mode and returns the error, if any.

func ScanAll

func ScanAll(t *testing.T, scan *sliceio.Scanner, cols ...interface{})

ScanAll scans all entries from the scanner into the provided columns, which must be pointers to slices of the correct column types. For example, to read all values for a Slice<int, string>:

var (
	ints []int
	strings []string
)
ScanAll(test, scan, &ints, &strings)

Errors are reported as fatal to the provided t instance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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