assertx

package
v0.0.153 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 12 Imported by: ? 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

The code has been taken from "github.com/stretchr/testify/assert" but with a slight modification to use go-cmp instead of reflect in order to support additional options like IgnoreFields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ElementsMatch

func ElementsMatch(t assert.TestingT, listA, listB interface{}, opts ...cmp.Option) (ok bool)

ElementsMatch asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, the number of appearances of each of them in both lists should match.

assert.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2])

func Equal added in v0.0.15

func Equal(t assert.TestingT, expected interface{}, actual interface{}, opts ...cmp.Option) (ok bool)

func EqualAsJSON

func EqualAsJSON(t require.TestingT, expected, actual interface{}, args ...interface{}) bool

func EqualAsJSONExcept

func EqualAsJSONExcept(t require.TestingT, expected, actual interface{}, except []string, args ...interface{}) bool

func PrettifyJSONPayload

func PrettifyJSONPayload(t require.TestingT, payload interface{}) string

func TimeDifferenceLess

func TimeDifferenceLess(t require.TestingT, t1, t2 time.Time, seconds int) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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