testutil

package
v0.0.0-...-3890e79 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestChannelUUID1 = uuid.MustParse("11111111-1111-1111-1111-111111111111")
	TestChannelUUID2 = uuid.MustParse("22222222-2222-2222-2222-222222222222")
	TestDeviceUUID1  = uuid.MustParse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")
	TestDeviceUUID2  = uuid.MustParse("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb")
	TestAppletUUID1  = uuid.MustParse("cccccccc-cccc-cccc-cccc-cccccccccccc")
	TestAppletUUID2  = uuid.MustParse("dddddddd-dddd-dddd-dddd-dddddddddddd")
)

Test UUIDs for consistent test data

Functions

func IntPtr

func IntPtr(i int) *int

IntPtr returns a pointer to the given int

func NewTestStore

func NewTestStore() (*durable.Store, func(), error)

NewTestStore creates an in-memory durable.Store for testing. Returns the store and a cleanup function.

func StringPtr

func StringPtr(s string) *string

StringPtr returns a pointer to the given string

Types

type TestDB

type TestDB struct {
	DB *sqlair.DB
	// contains filtered or unexported fields
}

TestDB holds the database connection for testing

func NewTestDB

func NewTestDB() (*TestDB, func(), error)

NewTestDB creates a new in-memory SQLite database for testing. Returns the database and a cleanup function that should be called when done.

func (*TestDB) Exec

func (t *TestDB) Exec(stmt string) error

Exec executes a raw SQL statement for test setup

func (*TestDB) Store

func (t *TestDB) Store() *durable.Store

Store returns a durable.Store using this test database

Jump to

Keyboard shortcuts

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