testassert

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package testassert provides shared assertion helpers for tests.

New code should import this package instead of the legacy testutils path:

import "github.com/InsideGallery/core/testassert"

testassert.Equal(t, got, want)

Compatibility: github.com/InsideGallery/core/testutils remains available for existing tests. Prefer testassert in new tests so assertions have a focused package name and do not extend the legacy utility aggregate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproximatelyEqual

func ApproximatelyEqual(a, b float64) bool

ApproximatelyEqual reports whether two floats are nearly equal.

func Equal

func Equal(t testing.TB, received, expected interface{})

Equal fails the test when two values are not equivalent.

func EqualError

func EqualError(received, expected error) bool

EqualError reports whether two errors are equivalent.

func EqualJSON

func EqualJSON(t testing.TB, received, expected []byte)

EqualJSON fails the test when two JSON values are not equivalent.

func IsEqual

func IsEqual(received, expected interface{}) bool

IsEqual reports whether two values are equivalent.

func NotEqual

func NotEqual(t testing.TB, received, expected interface{})

NotEqual fails the test when two values are equivalent.

func NotEqualJSON

func NotEqualJSON(t testing.TB, received, expected []byte)

NotEqualJSON fails the test when two JSON values are equivalent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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