protoassert

package
v1.23.0-rc13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Assert wraps testify's require package with useful helpers

The following helpers are slightly modified versions of those found in testify's assert package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(t assert.TestingT, a any, b any) bool

func NotProtoEqual

func NotProtoEqual(t assert.TestingT, a proto.Message, b proto.Message) bool

func ProtoElementsMatch

func ProtoElementsMatch(t assert.TestingT, a any, b any, msgAndArgs ...any) bool

ProtoElementsMatch behaves like assert.ElementsMatch except in that it works for google/protobuf-generated structs

func ProtoEqual

func ProtoEqual(t assert.TestingT, a proto.Message, b proto.Message) bool

ProtoEqual compares two proto.Message objects for equality

func ProtoSliceEqual

func ProtoSliceEqual[T proto.Message](t assert.TestingT, a []T, b []T) bool

ProtoSliceEqual compares elements in a slice of proto.Message. This is not a method on the suite type because methods cannot have generic parameters and slice casting (say from []historyEvent) to []proto.Message is impossible

Types

type ProtoAssertions

type ProtoAssertions struct {
	// contains filtered or unexported fields
}

func New

func (ProtoAssertions) DeepEqual

func (x ProtoAssertions) DeepEqual(a any, b any) bool

func (ProtoAssertions) NotProtoEqual

func (x ProtoAssertions) NotProtoEqual(a proto.Message, b proto.Message) bool

func (ProtoAssertions) ProtoElementsMatch

func (x ProtoAssertions) ProtoElementsMatch(a any, b any) bool

func (ProtoAssertions) ProtoEqual

func (x ProtoAssertions) ProtoEqual(a proto.Message, b proto.Message) bool

Jump to

Keyboard shortcuts

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