bigslice: github.com/grailbio/bigslice/slicetest Index | Files

package slicetest

import "github.com/grailbio/bigslice/slicetest"

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

Package Files

run.go

func Run Uses

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 Uses

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 Uses

func RunErr(slice bigslice.Slice) error

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

func ScanAll Uses

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.

Package slicetest imports 6 packages (graph). Updated 2019-11-21. Refresh now. Tools for package owners.