mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Add helper Matcher for logging the rooms section
Useful for debugging a test.
This commit is contained in:
parent
4eb9bcc27f
commit
64183a3b99
@ -644,6 +644,15 @@ func LogResponse(t *testing.T) RespMatcher {
|
||||
}
|
||||
}
|
||||
|
||||
// LogRooms is like LogResponse, but only logs the rooms section of the response.
|
||||
func LogRooms(t *testing.T) RespMatcher {
|
||||
return func(res *sync3.Response) error {
|
||||
dump, _ := json.MarshalIndent(res.Rooms, "", " ")
|
||||
t.Logf("Response rooms were: %s", dump)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func CheckList(listKey string, res sync3.ResponseList, matchers ...ListMatcher) error {
|
||||
for _, m := range matchers {
|
||||
if err := m(res); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user