test

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ptr added in v0.4.0

func Ptr[T any](x T) *T

func Setup

func Setup(t TestingT) (*raptor.Conn, context.Context)

Types

type CollectQueryLogger

type CollectQueryLogger struct {
	Queries []CollectedQuery
}

func (*CollectQueryLogger) LogQuery

func (l *CollectQueryLogger) LogQuery(_ context.Context, q string, a []any)

func (*CollectQueryLogger) Reset

func (l *CollectQueryLogger) Reset()

type CollectedQuery

type CollectedQuery struct {
	Query string
	Args  []any
}

type Person

type Person struct {
	ID        int64
	FirstName string
	LastName  string
}

type Pet

type Pet struct {
	ID       int64
	PersonID int64  `db:"ParentID"`
	Kind     string `db:"Type"`
	Name     string
	Age      *int
}

type TestQueryLogger

type TestQueryLogger struct {
	TestingT
}

func (*TestQueryLogger) LogQuery

func (l *TestQueryLogger) LogQuery(_ context.Context, q string, _ []any)

type TestingT

type TestingT interface {
	require.TestingT
	assert.TestingT

	Log(...any)
	Logf(string, ...any)
	Name() string
	Cleanup(func())
}

Jump to

Keyboard shortcuts

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