-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a test for paginated search results #110
Conversation
... and it fails because the fix isn't on develop yet. |
|
||
my $results = $room_events->{results}; | ||
scalar @$results == 10 or die "Expected 10 search results"; | ||
$results->[0]{result}{event_id} eq $event_ids[19] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be done with
assert_eq( $results->[0]{result}{event_id}, $event_ids[19],
'first result event_id' );
which prints the expected/actual values on failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's new!
Done.
Overall: the test appears to be expecting that search results come in batches of 10 each, but the search parameters didn't request exactly 10. This feels like it's a fragile assumption of implementation. Is there perhaps a limit parameter that can be specified? |
Set the limit on the search query. Other minor cleanups.
good point about the implicit limit. Now made explicit. |
LGTM |
ta |
Add a test for paginated search results
This tests the fix added at matrix-org/synapse#447