tests

package
v0.0.0-...-7006b8f Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package tests provides shared test helpers and assertions for XDB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertDefEqual

func AssertDefEqual(t *testing.T, expected, actual *schema.Def)

AssertDefEqual asserts that two schema definitions are equal.

func AssertEqualRecord

func AssertEqualRecord(t *testing.T, expected, actual *core.Record)

AssertEqualRecord asserts that two records are equal. It checks for the following: - The record URIs are equal. - The record tuples are equal.

func AssertEqualRecords

func AssertEqualRecords(t *testing.T, expected, actual []*core.Record)

AssertEqualRecords asserts that two lists of records are equal.

func AssertEqualTuple

func AssertEqualTuple(t *testing.T, expected, actual *core.Tuple)

AssertEqualTuple asserts that two tuples are equal.

func AssertEqualTuples

func AssertEqualTuples(t *testing.T, expected, actual []*core.Tuple)

AssertEqualTuples asserts that two lists of tuples are equal.

func AssertEqualURI

func AssertEqualURI(t *testing.T, expected, actual *core.URI)

AssertEqualURI asserts that two URIs are equal.

func AssertEqualURIs

func AssertEqualURIs(t *testing.T, expected, actual []*core.URI)

AssertEqualURIs asserts that two lists of URIs are equal.

func AssertEqualValues

func AssertEqualValues(t *testing.T, expected, actual *core.Value)

AssertEqualValues asserts that two values are equal.

func AssertFieldDefEqual

func AssertFieldDefEqual(t *testing.T, expected, actual *schema.FieldDef)

AssertFieldDefEqual asserts that two field definitions are equal.

func FakeAllTypesRecord

func FakeAllTypesRecord() *core.Record

FakeAllTypesRecord creates a fake record with comprehensive type coverage.

func FakeAllTypesSchema

func FakeAllTypesSchema() *schema.Def

FakeAllTypesSchema creates a fake schema covering all XDB types.

func FakePost

func FakePost() *core.Record

FakePost creates a fake record with fake Post data.

func FakePostSchema

func FakePostSchema() *schema.Def

FakePostSchema creates a fake schema of a Post.

func FakePosts

func FakePosts(n int) []*core.Record

FakePosts creates a list of fake records.

func FakeTuples

func FakeTuples() []*core.Tuple

FakeTuples creates a list of fake tuples covering all core types.

Types

type RecordStoreTestSuite

type RecordStoreTestSuite struct {
	// contains filtered or unexported fields
}

func NewRecordStoreTestSuite

func NewRecordStoreTestSuite(d store.RecordStore) *RecordStoreTestSuite

func (*RecordStoreTestSuite) Basic

func (s *RecordStoreTestSuite) Basic(t *testing.T)

func (*RecordStoreTestSuite) ValidationDynamic

func (s *RecordStoreTestSuite) ValidationDynamic(t *testing.T)

func (*RecordStoreTestSuite) ValidationFlexible

func (s *RecordStoreTestSuite) ValidationFlexible(t *testing.T)

func (*RecordStoreTestSuite) ValidationStrict

func (s *RecordStoreTestSuite) ValidationStrict(t *testing.T)

type SchemaStoreTestSuite

type SchemaStoreTestSuite struct {
	// contains filtered or unexported fields
}

func NewSchemaStoreTestSuite

func NewSchemaStoreTestSuite(d store.SchemaStore) *SchemaStoreTestSuite

func (*SchemaStoreTestSuite) AddNewFields

func (s *SchemaStoreTestSuite) AddNewFields(t *testing.T)

func (*SchemaStoreTestSuite) Basic

func (s *SchemaStoreTestSuite) Basic(t *testing.T)

func (*SchemaStoreTestSuite) DropFields

func (s *SchemaStoreTestSuite) DropFields(t *testing.T)

func (*SchemaStoreTestSuite) EdgeCases

func (s *SchemaStoreTestSuite) EdgeCases(t *testing.T)

func (*SchemaStoreTestSuite) ListSchemas

func (s *SchemaStoreTestSuite) ListSchemas(t *testing.T)

func (*SchemaStoreTestSuite) ModifyFields

func (s *SchemaStoreTestSuite) ModifyFields(t *testing.T)

type TupleStoreTestSuite

type TupleStoreTestSuite struct {
	// contains filtered or unexported fields
}

func NewTupleStoreTestSuite

func NewTupleStoreTestSuite(d store.TupleStore) *TupleStoreTestSuite

func (*TupleStoreTestSuite) Basic

func (s *TupleStoreTestSuite) Basic(t *testing.T)

func (*TupleStoreTestSuite) ValidationDynamic

func (s *TupleStoreTestSuite) ValidationDynamic(t *testing.T)

func (*TupleStoreTestSuite) ValidationFlexible

func (s *TupleStoreTestSuite) ValidationFlexible(t *testing.T)

func (*TupleStoreTestSuite) ValidationStrict

func (s *TupleStoreTestSuite) ValidationStrict(t *testing.T)

Jump to

Keyboard shortcuts

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