test

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 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, got, want geom.Geometry, opts ...geom.ExactEqualsOption)

func ExactEqualsWKT added in v0.58.0

func ExactEqualsWKT(tb testing.TB, got geom.Geometry, wantWKT string, opts ...geom.ExactEqualsOption)

func False added in v0.57.0

func False(tb testing.TB, cond bool)

func FromWKT added in v0.58.0

func FromWKT(tb testing.TB, wkt string) geom.Geometry

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, got, doNotWant 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