test

package
v5.0.0-...-9032225 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunGenericTests

func RunGenericTests[T Testable](testcases []T, t *testing.T, f func(ctx context.Context, testcase T))

func RunServicesTests

func RunServicesTests(testCases []ServicesStorageTestCase, t *testing.T, f func(context.Context))

RunServicesTests initialize a runtime and run the tests cases with correct DAOs in context

func RunStorageTests

func RunStorageTests(testCases []StorageTestCase, t *testing.T, f func(context.Context))

RunStorageTests initialize a runtime and run the tests cases with correct DAOs in context

func RunTests

func RunTests(t *testing.T, init func(context.Context), f func(context.Context))

Types

type ServicesStorageTestCase

type ServicesStorageTestCase struct {
	DSN       map[string]string
	Condition bool
	Services  map[string]map[string]any
	Label     string
}

type StorageTestCase

type StorageTestCase struct {
	DSN       []string
	Condition bool
	DAO       any
	Label     string
}

func TemplateBleveWithPrefix

func TemplateBleveWithPrefix(daoFunc any, prefix string) StorageTestCase

TemplateBleveWithPrefix creates a StorageTestCase for BleveDB

func TemplateBoltWithPrefix

func TemplateBoltWithPrefix(daoFunc any, prefix string) StorageTestCase

TemplateBoltWithPrefix creates a StorageTestCase for BoltDB

func TemplateMongoEnvWithPrefix

func TemplateMongoEnvWithPrefix(daoFunc any, prefix string) StorageTestCase

TemplateMongoEnvWithPrefix creates a StorageTestCase for MongoDB

func TemplateMongoEnvWithPrefixAndIndexerCollection

func TemplateMongoEnvWithPrefixAndIndexerCollection(daoFunc any, prefix, collection string) StorageTestCase

TemplateMongoEnvWithPrefixAndIndexerCollection creates a StorageTestCase for MongoDB

func TemplateSQL

func TemplateSQL(daoFunc any) []StorageTestCase

TemplateSQL returns a single SQL test case with the provided DAO func

type T

type T testing.T

func (*T) Run

func (t *T) Run(name string, f func(*testing.T)) bool

type Testable

type Testable interface {
	Label() string
}

Jump to

Keyboard shortcuts

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