Documentation ¶
Index ¶
- Variables
- func AssertEventIDsEqual(t *testing.T, gotEventIDs []string, wants []*gomatrixserverlib.HeaderedEvent)
- func AssertEventsEqual(t *testing.T, gots, wants []*gomatrixserverlib.HeaderedEvent)
- func Base(cfg *config.Dendrite) (*base.BaseDendrite, nats.JetStreamContext, *nats.Conn)
- func CreateBaseDendrite(t *testing.T, dbType DBType) (*base.BaseDendrite, func())
- func MustPublishMsgs(t *testing.T, jsctx nats.JetStreamContext, msgs ...*nats.Msg)
- func NewOutputEventMsg(t *testing.T, base *base.BaseDendrite, roomID string, update api.OutputEvent) *nats.Msg
- func NewRequest(t *testing.T, method, path string, opts ...HTTPRequestOpt) *http.Request
- 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 HTTPRequestOpt
- 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
View Source
var Required = os.Getenv("DENDRITE_TEST_SKIP_NODB") == ""
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 Base ¶ added in v0.8.3
func Base(cfg *config.Dendrite) (*base.BaseDendrite, nats.JetStreamContext, *nats.Conn)
func CreateBaseDendrite ¶ added in v0.8.3
func CreateBaseDendrite(t *testing.T, dbType DBType) (*base.BaseDendrite, func())
func MustPublishMsgs ¶ added in v0.8.3
func NewOutputEventMsg ¶ added in v0.8.3
func NewOutputEventMsg(t *testing.T, base *base.BaseDendrite, roomID string, update api.OutputEvent) *nats.Msg
func NewRequest ¶ added in v0.8.3
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 HTTPRequestOpt ¶ added in v0.8.3
func WithJSONBody ¶ added in v0.8.3
func WithJSONBody(t *testing.T, body interface{}) HTTPRequestOpt
func WithQueryParams ¶ added in v0.8.3
func WithQueryParams(qps map[string]string) HTTPRequestOpt
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.