test

package module
v0.0.0-...-c5192e7 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnyOfOrderedMatcher

func NewAnyOfOrderedMatcher[T constraints.Ordered](ss ...T) anyOfOrderedMatcher[T]

func NewOrderedKeysMatcher

func NewOrderedKeysMatcher[T any, Key constraints.Ordered](orderKeyGetter func(T) Key, want ...T) *orderedKeysMatcher[T, Key]

func NewOrderedMatcher

func NewOrderedMatcher[T constraints.Ordered](want ...T) *orderedMatcher[T]

Types

type ArgsMigrations

type ArgsMigrations[Args any, Migrations any] struct {
	Name       string
	Args       Args
	Migrations Migrations
}

type CompMatcher

type CompMatcher[Want any] struct {
	*ErrMsgMatcherBase
	// contains filtered or unexported fields
}

func NewCompMatcher

func NewCompMatcher[Want any](want Want) *CompMatcher[Want]

Compare gomock function arg by testify Ex:

var t *testing.T
mockCtl := gomock.NewController(t)
mockObj := NewMockIGoMockObj(mockCtl)

mockObj.EXPECT().Run(
    test.NewCompMatcher(
        &Want{},
    ),
)

func (*CompMatcher[Want]) String

func (m *CompMatcher[Want]) String() string

type ErrMsgMatcherBase

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

func NewErrMsgMatcherBase

func NewErrMsgMatcherBase(matcher IMatcher) *ErrMsgMatcherBase

func (*ErrMsgMatcherBase) Got

func (m *ErrMsgMatcherBase) Got(got any) string

Got is invoked with the received value. The result is used when printing the failure message.

func (*ErrMsgMatcherBase) Matches

func (m *ErrMsgMatcherBase) Matches(x any) bool

type FuncMatcher

type FuncMatcher[Got any] struct {
	*ErrMsgMatcherBase
	// contains filtered or unexported fields
}

func NewFuncMatcher

func NewFuncMatcher[Got any](checkFn func(got Got) (ok bool, msg string)) *FuncMatcher[Got]

func (*FuncMatcher[Got]) String

func (m *FuncMatcher[Got]) String() string

type IMatcher

type IMatcher interface {

	// String describes what the matcher matches.
	String() string
	// contains filtered or unexported methods
}

type ITestSuit

type ITestSuit[Args any, Migrations any, Wants any] interface {
	MakeTestCases() []TestCase[Args, Migrations, Wants]
}

type SameWantsTestSuit

type SameWantsTestSuit[Args any, Migrations any, Wants any] struct {
	Name           string
	ArgsMigrations []ArgsMigrations[Args, Migrations]
	Wants          Wants
}

func NewSameWantsTestSuit

func NewSameWantsTestSuit[Args any, Migrations any, Wants any](argsMigrations []ArgsMigrations[Args, Migrations], wants Wants) *SameWantsTestSuit[Args, Migrations, Wants]

func NewSameWantsTestSuitWithName

func NewSameWantsTestSuitWithName[Args any, Migrations any, Wants any](name string, argsMigrations []ArgsMigrations[Args, Migrations], wants Wants) *SameWantsTestSuit[Args, Migrations, Wants]

func (*SameWantsTestSuit[Args, Migrations, Wants]) MakeTestCases

func (ts *SameWantsTestSuit[Args, Migrations, Wants]) MakeTestCases() []TestCase[Args, Migrations, Wants]

type TestCase

type TestCase[Args any, Migrations any, Wants any] struct {
	Name       string
	Args       Args
	Migrations Migrations
	Wants      Wants
}

func NewTestCase

func NewTestCase[Args any, Migrations any, Wants any](args Args, migrations Migrations, wants Wants) *TestCase[Args, Migrations, Wants]

func NewTestCaseWithName

func NewTestCaseWithName[Args any, Migrations any, Wants any](name string, args Args, migrations Migrations, wants Wants) *TestCase[Args, Migrations, Wants]

func (*TestCase[Args, Migrations, Wants]) MakeTestCases

func (tc *TestCase[Args, Migrations, Wants]) MakeTestCases() []TestCase[Args, Migrations, Wants]

type TestCases

type TestCases[Args any, Migrations any, Wants any] []ITestSuit[Args, Migrations, Wants]

func (TestCases[Args, Migrations, Wants]) MakeTestCases

func (tss TestCases[Args, Migrations, Wants]) MakeTestCases() []TestCase[Args, Migrations, Wants]

Jump to

Keyboard shortcuts

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