Documentation
¶
Index ¶
- func CompareAndSetByPathNum(tb testing.TB, expected, actual types.CompositeType, delta float64, ...)
- func CompareAndSetByPathTime(tb testing.TB, expected, actual types.CompositeType, delta time.Duration, ...)
- func CreateTable(ctx context.Context, tb testing.TB, pool *pg.Pool, db string) string
- func Ctx(tb testing.TB) context.Context
- func GetByPath(tb testing.TB, comp types.CompositeType, path ...string) any
- func MustParseDumpFile(path ...string) []byte
- func ParseDump(tb testing.TB, s string) []byte
- func ParseDumpFile(tb testing.TB, path ...string) []byte
- func Pool(_ context.Context, tb testing.TB, opts *PoolOpts) *pg.Pool
- func Schema(ctx context.Context, tb testing.TB, pool *pg.Pool) string
- func SchemaName(tb testing.TB) string
- func SetByPath(tb testing.TB, comp types.CompositeType, value any, path ...string)
- func TableName(tb testing.TB) string
- type PoolOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAndSetByPathNum ¶ added in v0.0.5
func CompareAndSetByPathNum(tb testing.TB, expected, actual types.CompositeType, delta float64, path ...string)
CompareAndSetByPathNum asserts that two values with the same path in two objects (documents or arrays) are within a given numerical delta, then updates the expected object with the actual value.
func CompareAndSetByPathTime ¶ added in v0.0.5
func CompareAndSetByPathTime(tb testing.TB, expected, actual types.CompositeType, delta time.Duration, path ...string)
CompareAndSetByPathTime asserts that two values with the same path in two objects (documents or arrays) are within a given time delta, then updates the expected object with the actual value.
func CreateTable ¶ added in v0.0.5
CreateTable creates FerretDB collection / PostgreSQL table for testing.
Name is stable for that test.
func GetByPath ¶ added in v0.0.5
GetByPath returns a value by path - a sequence of indexes and keys.
func MustParseDumpFile ¶
func Schema ¶
Schema creates a new FerretDB database / PostgreSQL schema for testing.
Name is stable for that test. It is automatically dropped if test pass.
func SchemaName ¶ added in v0.0.5
SchemaName returns a stable schema name for that test.