Documentation ¶
Index ¶
- func Any[T any, S ~[]T](a, b S) differs.Data
- func Bytes(a, b []byte) differs.Data
- func Chars(a, b string) differs.Data
- func Comparable[T comparable, S ~[]T](a, b S) differs.Data
- func Ints(a, b []int) differs.Data
- func New(aCount, bCount int, equals func(aIndex, bIndex int) bool) *imp
- func Regex[T any](patterns []string, parts []T) differs.Data
- func RuneSlice(a, b [][]rune) differs.Data
- func Runes(a, b []rune) differs.Data
- func Strings(a, b []string) differs.Data
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Any ¶
Any creates data for comparing any type in two slices using utils.Equal.
Since utils.Equal may perform a reflection's deep equal, this may be slower than more specific data comparisons.
func Chars ¶
Chars creates data for comparing characters in two strings.
Warning: This does not handle escaped utf-8 sequences as a unit, this uses Go's default length and indexing for strings. For full unicode support use the Runes instead.
func Comparable ¶
func Comparable[T comparable, S ~[]T](a, b S) differs.Data
Comparable creates data for comparing comparable data types in two slices.
This can be used for int64, uint64, or any other types that are comparable.
func New ¶
New creates a comparer for comparing two collections of data.
The given counts are the size of the A and B data. The given equals function can be called for any index between zero and the count. `aIndex` is the index in the A data between zero and `aCount`. `bIndex` is the index in the B data between zero and `bCount`. The index pairs may be called in any order and multiple times.
func Regex ¶
Regex creates data for comparing a collection of parts against a collection of regular expressions.
This is designed for checking a set of results which have some variability against expected patterns for the result.
func RuneSlice ¶
RuneSlice creates data for comparing rune slices in two slices of slices.
This is similar to Strings except functions for unicode text.
Types ¶
This section is empty.