MCPcopy Create free account
hub / github.com/daodst/chat / assertInputRoomEvents

Function assertInputRoomEvents

federationapi/routing/send_test.go:242–255  ·  view source on GitHub ↗

* func fromStateTuples(tuples []gomatrixserverlib.StateKeyTuple, omitTuples []gomatrixserverlib.StateKeyTuple) (result []*gomatrixserverlib.HeaderedEvent) { NextTuple: for _, t := range tuples { for _, o := range omitTuples { if t == o { break NextTuple } } h, ok := testSta

(t *testing.T, got []api.InputRoomEvent, want []*gomatrixserverlib.HeaderedEvent)

Source from the content-addressed store, hash-verified

240*/
241
242func assertInputRoomEvents(t *testing.T, got []api.InputRoomEvent, want []*gomatrixserverlib.HeaderedEvent) {
243 for _, g := range got {
244 fmt.Println("GOT ", g.Event.EventID())
245 }
246 if len(got) != len(want) {
247 t.Errorf("wrong number of InputRoomEvents: got %d want %d", len(got), len(want))
248 return
249 }
250 for i := range got {
251 if got[i].Event.EventID() != want[i].EventID() {
252 t.Errorf("InputRoomEvents[%d] got %s want %s", i, got[i].Event.EventID(), want[i].EventID())
253 }
254 }
255}
256
257// The purpose of this test is to check that receiving an event over federation for which we have the prev_events works correctly, and passes it on
258// to the roomserver. It's the most basic test possible.

Callers 2

TestBasicTransactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected