testutil

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Fixtures = &fixtures{}

Functions

func Assets

func Assets(t *testing.T) web.Assets

Assets returns the _real_ assets used to render the web server. Instead of being embedded normally, this will hacky load the assets at runtime.

func TempFile

func TempFile(t *testing.T, filename, content string) string

TempFile creates a temporary file with the given filename and content. The file's directory is deleted when the test finishes.

Types

type Database added in v0.13.0

type Database struct {
	*db.DB
	SQL    *sql.DB
	Schema string
}

func NewDatabase added in v0.13.0

func NewDatabase(t *testing.T, driver dsn.Driver, compress bool) *Database

type LogRecorder added in v0.13.0

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

func SetLogRecorder added in v0.13.0

func SetLogRecorder(t *testing.T) *LogRecorder

func (*LogRecorder) AssertLog added in v0.13.0

func (l *LogRecorder) AssertLog(t *testing.T, lvl slog.Level, substr string)

func (*LogRecorder) Enabled added in v0.13.0

func (l *LogRecorder) Enabled(_ context.Context, _ slog.Level) bool

func (*LogRecorder) Handle added in v0.13.0

func (l *LogRecorder) Handle(_ context.Context, r slog.Record) error

func (*LogRecorder) RefuteLog added in v0.13.0

func (l *LogRecorder) RefuteLog(t *testing.T, lvl slog.Level, substr string)

func (*LogRecorder) WithAttrs added in v0.13.0

func (l *LogRecorder) WithAttrs(_ []slog.Attr) slog.Handler

func (*LogRecorder) WithGroup added in v0.13.0

func (l *LogRecorder) WithGroup(_ string) slog.Handler

Jump to

Keyboard shortcuts

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