test

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package test provides test helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproxEqual added in v0.57.0

func ApproxEqual(tb testing.TB, got, want float64, tol Tolerance)

ApproxEqual asserts that two float64 values are approximately equal. The comparison passes if the difference is within either the relative tolerance or the absolute tolerance.

func DeepEqual added in v0.56.0

func DeepEqual(tb testing.TB, a, b any)

func Eq added in v0.57.0

func Eq[T comparable](tb testing.TB, got, want T)

func Err

func Err(tb testing.TB, err error)

func ErrAs added in v0.55.0

func ErrAs(tb testing.TB, err error, target any)

func ExactEquals added in v0.56.0

func ExactEquals(tb testing.TB, g1, g2 geom.Geometry, opts ...geom.ExactEqualsOption)

func False added in v0.57.0

func False(tb testing.TB, cond bool)

func NoErr

func NoErr(tb testing.TB, err error)

func NotDeepEqual added in v0.56.0

func NotDeepEqual(tb testing.TB, a, b any)

func NotExactEquals added in v0.56.0

func NotExactEquals(tb testing.TB, g1, g2 geom.Geometry, opts ...geom.ExactEqualsOption)

func True added in v0.57.0

func True(tb testing.TB, cond bool)

Types

type Tolerance added in v0.57.0

type Tolerance struct {
	Rel float64 // Relative tolerance: diff must be <= Rel * max(|got|, |want|).
	Abs float64 // Absolute tolerance: diff must be <= Abs.
}

Tolerance specifies tolerances for approximate float comparison.

Jump to

Keyboard shortcuts

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