(t *testing.T, txn *txnReq, pdusWithErrors []string)
| 198 | } |
| 199 | |
| 200 | func mustProcessTransaction(t *testing.T, txn *txnReq, pdusWithErrors []string) { |
| 201 | res, err := txn.processTransaction(context.Background()) |
| 202 | if err != nil { |
| 203 | t.Errorf("txn.processTransaction returned an error: %v", err) |
| 204 | return |
| 205 | } |
| 206 | if len(res.PDUs) != len(txn.PDUs) { |
| 207 | t.Errorf("txn.processTransaction did not return results for all PDUs, got %d want %d", len(res.PDUs), len(txn.PDUs)) |
| 208 | return |
| 209 | } |
| 210 | NextPDU: |
| 211 | for eventID, result := range res.PDUs { |
| 212 | if result.Error == "" { |
| 213 | continue |
| 214 | } |
| 215 | for _, eventIDWantError := range pdusWithErrors { |
| 216 | if eventID == eventIDWantError { |
| 217 | break NextPDU |
| 218 | } |
| 219 | } |
| 220 | t.Errorf("txn.processTransaction PDU %s returned an error %s", eventID, result.Error) |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | /* |
| 225 | func fromStateTuples(tuples []gomatrixserverlib.StateKeyTuple, omitTuples []gomatrixserverlib.StateKeyTuple) (result []*gomatrixserverlib.HeaderedEvent) { |
no test coverage detected