modeltest

package
v0.28.44 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package modeltest holds test utilities for packages that depend on model package. It allows for easy running tests on graph building functions that depends on model.Scope objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTestGraphFn

func RunTestGraphFn(t *testing.T, testName string, graphFn TestScopeGraphFn, 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 TestScopeGraphFn

type TestScopeGraphFn func(scope *model.Scope, g *Graph) (inputs, outputs []*Node)

TestScopeGraphFn 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