mockassert

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 4 Imported by: 0

README

✅ Gomock Assert

gomockassert is a matcher that uses testify/assert to perform matches.

⬇️ Installation

go get github.com/survivorbat/go-mockassert

📋 Usage

🔭 Plans

Not much yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher struct {
	T        *testing.T
	Expected any
}

Matcher implements gomock.Matcher and uses Expected to assert.Equal to actual.

func New

func New[T any](t *testing.T, expected T) *Matcher

New can be thrown directly into a EXPECT() call with the value you're expecting

func (*Matcher) Matches

func (m *Matcher) Matches(actual any) bool

Matches checks whether the expected value matches the actual

func (*Matcher) String

func (m *Matcher) String() string

String returns the type name that the matcher was created for

Jump to

Keyboard shortcuts

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