assertdeep

package
v0.0.0-...-1483051 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(t sktest.TestingT, a, b interface{})

Copy is Equal but also checks that none of the direct fields have a zero value and none of the direct fields point to the same object. This catches regressions where a new field is added without adding that field to the Copy method. Arguments must be structs. Does not check private fields.

func Diff

func Diff(x, y interface{}) string

Diff determines whether the two values are DeepEqual. If they are not equal, it returns a string diff of the two, otherwise it returns the empty string.

func Equal

func Equal(t sktest.TestingT, expected, actual interface{})

Equal fails the test if the two objects do not pass a modified version of reflect.DeepEqual. The modification (see infra/go/deepequal) will use the .Equal() method if defined on the type. This is necessary for comparing structs that might differ on unexported fields, but be practically the same. This concretely comes up often when deserialzing a time.Time, but applies in a few other situations as well.

Types

This section is empty.

Jump to

Keyboard shortcuts

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