compare

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package compare contains the value comparer interface, and types implementing the value comparer interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValuesDiffer

func ValuesDiffer() valuesDiffer

ValuesDiffer returns a ValueComparer for asserting that each value in the sequence of the values supplied to the CompareValues method differs from the preceding value.

func ValuesSame

func ValuesSame() valuesSame

ValuesSame returns a ValueComparer for asserting that each value in the sequence of the values supplied to the CompareValues method is the same as the preceding value.

Types

type ValueComparer

type ValueComparer interface {
	// CompareValues should assert the given known values against any expectations.
	// Values are always ordered in the order they were added. Use the error
	// return to signal unexpected values or implementation errors.
	CompareValues(values ...any) error
}

ValueComparer defines an interface that is implemented to run comparison logic on multiple values. Individual implementations determine how the comparison is performed (e.g., values differ, values equal).

Jump to

Keyboard shortcuts

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