cmp

package
v5.1.2-bit Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparison

type Comparison = gotest.Comparison

func Contains

func Contains(collection, item interface{}) Comparison

Contains succeeds if item is in collection. The collection may be a string, map, slice, or array. See gotest.tools/v3/assert/cmp.Contains. When either item or collection is a multi-line string, the failure message contains a multi-line report of the differences.

func DeepEqual

func DeepEqual(x, y interface{}, opts ...gocmp.Option) Comparison

DeepEqual compares two values using github.com/google/go-cmp/cmp and succeeds if the values are equal. The comparison can be customized using comparison Options. See github.com/google/go-cmp/cmp.Option constructors and github.com/google/go-cmp/cmp/cmpopts.

func MarshalMatches

func MarshalMatches(actual interface{}, expected string) Comparison

MarshalMatches converts actual to YAML and compares that to expected.

func Regexp

func Regexp(re interface{}, value string) Comparison

Regexp succeeds if value contains any match of the regular expression re. The regular expression may be a *regexp.Regexp or a string that is a valid regexp pattern.

Jump to

Keyboard shortcuts

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