testutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testutil provides shared test helpers for the oCMS project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestDB

func TestDB(t *testing.T) (*sql.DB, func())

TestDB creates a temporary test database with core migrations applied. Returns the database and a cleanup function that should be deferred.

func TestLogger

func TestLogger() *slog.Logger

TestLogger creates a silent test logger that only outputs warnings and errors.

func TestLoggerSilent

func TestLoggerSilent() *slog.Logger

TestLoggerSilent creates a completely silent test logger (error level only).

func TestMemoryDB

func TestMemoryDB(t *testing.T) *sql.DB

TestMemoryDB creates an in-memory SQLite database for testing. Useful for tests that don't need persistent storage or migrations.

Types

This section is empty.

Directories

Path Synopsis
Package moduleutil provides module-specific test helpers for the oCMS project.
Package moduleutil provides module-specific test helpers for the oCMS project.

Jump to

Keyboard shortcuts

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