m

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckList

func CheckList(i int, res sync3.ResponseList, matchers ...ListMatcher) error

func CheckRoom

func CheckRoom(r sync3.Room, matchers ...RoomMatcher) error

func EqualAnyOrder

func EqualAnyOrder(got, want []json.RawMessage) error

func MatchResponse

func MatchResponse(t *testing.T, res *sync3.Response, matchers ...RespMatcher)

Types

type ListMatcher

type ListMatcher func(list sync3.ResponseList) error

func MatchV3Count

func MatchV3Count(wantCount int) ListMatcher

func MatchV3Ops

func MatchV3Ops(matchOps ...OpMatcher) ListMatcher

type OpMatcher

type OpMatcher func(op sync3.ResponseOp) error

func MatchV3DeleteOp

func MatchV3DeleteOp(roomIndex int) OpMatcher

func MatchV3InsertOp

func MatchV3InsertOp(roomIndex int, roomID string) OpMatcher

func MatchV3InvalidateOp

func MatchV3InvalidateOp(start, end int64) OpMatcher

func MatchV3SyncOp

func MatchV3SyncOp(start, end int64, roomIDs []string, anyOrder ...bool) OpMatcher

func MatchV3SyncOpFn

func MatchV3SyncOpFn(fn func(op *sync3.ResponseOpRange) error) OpMatcher

type Receipt added in v0.7.3

type Receipt struct {
	EventID  string
	UserID   string
	Type     string
	ThreadID string
}

type RespMatcher

type RespMatcher func(res *sync3.Response) error

func MatchAccountData

func MatchAccountData(globals []json.RawMessage, rooms map[string][]json.RawMessage) RespMatcher

func MatchDeviceLists

func MatchDeviceLists(changed, left []string) RespMatcher

func MatchFallbackKeyTypes added in v0.3.1

func MatchFallbackKeyTypes(fallbackKeyTypes []string) RespMatcher

func MatchList

func MatchList(i int, matchers ...ListMatcher) RespMatcher

func MatchLists

func MatchLists(matchers ...[]ListMatcher) RespMatcher

func MatchNoV3Ops

func MatchNoV3Ops() RespMatcher

func MatchOTKCounts

func MatchOTKCounts(otkCounts map[string]int) RespMatcher

func MatchReceipts added in v0.7.3

func MatchReceipts(roomID string, wantReceipts []Receipt) RespMatcher

func MatchRoomSubscription

func MatchRoomSubscription(roomID string, matchers ...RoomMatcher) RespMatcher

func MatchRoomSubscriptions

func MatchRoomSubscriptions(wantSubs map[string][]RoomMatcher) RespMatcher

func MatchRoomSubscriptionsStrict

func MatchRoomSubscriptionsStrict(wantSubs map[string][]RoomMatcher) RespMatcher

func MatchToDeviceMessages

func MatchToDeviceMessages(wantMsgs []json.RawMessage) RespMatcher

func MatchTxnID added in v0.3.0

func MatchTxnID(txnID string) RespMatcher

func MatchTyping added in v0.7.2

func MatchTyping(roomID string, wantUserIDs []string) RespMatcher

type RoomMatcher

type RoomMatcher func(r sync3.Room) error

func MatchInviteCount added in v0.4.1

func MatchInviteCount(count int) RoomMatcher

func MatchJoinCount added in v0.4.1

func MatchJoinCount(count int) RoomMatcher

func MatchNumLive added in v0.7.4

func MatchNumLive(numLive int) RoomMatcher

func MatchRoomHighlightCount

func MatchRoomHighlightCount(count int64) RoomMatcher

func MatchRoomInitial

func MatchRoomInitial(initial bool) RoomMatcher

func MatchRoomInviteState

func MatchRoomInviteState(events []json.RawMessage) RoomMatcher

func MatchRoomName

func MatchRoomName(name string) RoomMatcher

func MatchRoomNotificationCount

func MatchRoomNotificationCount(count int64) RoomMatcher

func MatchRoomPrevBatch

func MatchRoomPrevBatch(prevBatch string) RoomMatcher

func MatchRoomRequiredState

func MatchRoomRequiredState(events []json.RawMessage) RoomMatcher

func MatchRoomTimeline

func MatchRoomTimeline(events []json.RawMessage) RoomMatcher

Match the timeline with exactly these events in exactly this order

func MatchRoomTimelineMostRecent

func MatchRoomTimelineMostRecent(n int, events []json.RawMessage) RoomMatcher

Similar to MatchRoomTimeline but takes the last n events of `events` and only checks with the last n events of the timeline.

Jump to

Keyboard shortcuts

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