Skip to main content
Testereiro - Test Engine Toolkit for Go
GitHub Go Docs Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Siqeltestage

Module: github.com/wrapped-owls/testereiro/providers/siqeltestage

siqeltestage adds typed object comparison validators for bancoche SQL assertions.

Install

1
go get github.com/wrapped-owls/testereiro/providers/siqeltestage

Usage

1
2
3
4
5
6
7
runner := bancoche.New(
	engine.DB(),
	bancoche.WithMapQuery("games", map[string]any{"id": 1}),
	siqeltestage.WithExpect(expectedGame),
)

err := engine.Execute(t, runner)

Custom Comparator

1
2
3
siqeltestage.WithExpectWithComparator(expected, func(t testing.TB, expected, actual MyType) bool {
	return reflect.DeepEqual(expected, actual)
})

You can also pass a sanitizer to normalize values before comparison.