testutil

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package testutil provides internal testing utilities for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual added in v6.0.2

func DeepEqual[T any](expected, actual T, message ...interface{}) (bool, string)

DeepEqual compares the expected and actual values using reflect.DeepEqual. It returns a boolean indicating whether the values are equal, and a string containing an error message if the values are not equal.

func GetDSN

func GetDSN(opts ...DSNOption) string

GetDSN returns the data source name for the database connection.

func NewTestDB

func NewTestDB(opts ...DSNOption) *gorm.DB

NewTestDB creates a new database connection (for internal use).

Types

type DSNOption

type DSNOption func(string) string

func WithDBName

func WithDBName(name string) DSNOption

WithDBName sets the database name for the connection.

Jump to

Keyboard shortcuts

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