assertx

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

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 *testing.T, expected, actual interface{}, args ...interface{})

func EqualAsJSONExcept

func EqualAsJSONExcept(t *testing.T, expected, actual interface{}, except []string, args ...interface{})

func PrettifyJSONPayload

func PrettifyJSONPayload(t *testing.T, payload interface{}) string

func TimeDifferenceLess

func TimeDifferenceLess(t *testing.T, t1, t2 time.Time, seconds int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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