Documentation ¶
Index ¶
- Variables
- func AssertEventIDsEqual(t *testing.T, gotEventIDs []string, wants []*gomatrixserverlib.HeaderedEvent)
- func AssertEventsEqual(t *testing.T, gots, wants []*gomatrixserverlib.HeaderedEvent)
- func PrepareDBConnectionString(t *testing.T, dbType DBType) (connStr string, close func())
- func Reversed(in []*gomatrixserverlib.HeaderedEvent) []*gomatrixserverlib.HeaderedEvent
- func RoomPreset(p Preset) roomModifier
- func RoomVersion(ver gomatrixserverlib.RoomVersion) roomModifier
- func WithAllDatabases(t *testing.T, testFn func(t *testing.T, db DBType))
- func WithStateKey(skey string) eventModifier
- func WithTimestamp(ts time.Time) eventModifier
- func WithUnsigned(unsigned interface{}) eventModifier
- type DBType
- type Preset
- type Room
- func (r *Room) CreateAndInsert(t *testing.T, creator *User, eventType string, content interface{}, ...) *gomatrixserverlib.HeaderedEvent
- func (r *Room) CreateEvent(t *testing.T, creator *User, eventType string, content interface{}, ...) *gomatrixserverlib.HeaderedEvent
- func (r *Room) Events() []*gomatrixserverlib.HeaderedEvent
- func (r *Room) InsertEvent(t *testing.T, he *gomatrixserverlib.HeaderedEvent)
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var Quiet = false
Functions ¶
func AssertEventIDsEqual ¶
func AssertEventIDsEqual(t *testing.T, gotEventIDs []string, wants []*gomatrixserverlib.HeaderedEvent)
func AssertEventsEqual ¶
func AssertEventsEqual(t *testing.T, gots, wants []*gomatrixserverlib.HeaderedEvent)
func PrepareDBConnectionString ¶
Prepare a sqlite or postgres connection string for testing. Returns the connection string to use and a close function which must be called when the test finishes. Calling this function twice will return the same database, which will have data from previous tests unless close() is called. TODO: namespace for concurrent package tests
func Reversed ¶
func Reversed(in []*gomatrixserverlib.HeaderedEvent) []*gomatrixserverlib.HeaderedEvent
Reverse a list of events
func RoomPreset ¶
func RoomPreset(p Preset) roomModifier
func RoomVersion ¶
func RoomVersion(ver gomatrixserverlib.RoomVersion) roomModifier
func WithAllDatabases ¶
Creates subtests with each known DBType
func WithStateKey ¶
func WithStateKey(skey string) eventModifier
func WithTimestamp ¶
func WithUnsigned ¶
func WithUnsigned(unsigned interface{}) eventModifier
Types ¶
type Room ¶
type Room struct { ID string Version gomatrixserverlib.RoomVersion // contains filtered or unexported fields }
func (*Room) CreateAndInsert ¶
func (r *Room) CreateAndInsert(t *testing.T, creator *User, eventType string, content interface{}, mods ...eventModifier) *gomatrixserverlib.HeaderedEvent
func (*Room) CreateEvent ¶
func (r *Room) CreateEvent(t *testing.T, creator *User, eventType string, content interface{}, mods ...eventModifier) *gomatrixserverlib.HeaderedEvent
Create an event in this room but do not insert it. Does not modify the room in any way (depth, fwd extremities, etc) so is thread-safe.
func (*Room) Events ¶
func (r *Room) Events() []*gomatrixserverlib.HeaderedEvent
func (*Room) InsertEvent ¶
func (r *Room) InsertEvent(t *testing.T, he *gomatrixserverlib.HeaderedEvent)
Add a new event to this room DAG. Not thread-safe.
Click to show internal directories.
Click to hide internal directories.