ctxtest

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package ctxtest holds test utilities for packages that depend on context package. It allows for easy running tests on graph building functions that depends on context.Context objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTestGraphFn

func RunTestGraphFn(t *testing.T, testName string, graphFn TestContextGraphFn, want []any, delta float64)

RunTestGraphFn tests a graph building function graphFn by executing it and comparing its output(s) to the values in want, reporting back any errors in t.

delta is the margin of value on the difference of output and want values that are acceptable. Values of delta <= 0 means only exact equality is accepted.

Types

type TestContextGraphFn

type TestContextGraphFn func(ctx *context.Context, g *Graph) (inputs, outputs []*Node)

TestContextGraphFn should build its own inputs, and return both inputs and outputs

Jump to

Keyboard shortcuts

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