summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-12-07 11:19:43 +0000
committerGitHub <noreply@github.com>2022-12-07 11:19:43 +0000
commitcf1059d045640485a5a0b1e3d945b796b0e6f228 (patch)
treee0e408463d49bcc58865127b354aa826c2a701e6 /tests
parentFaster remote room joins: unblock tasks waiting for full room state when the ... (diff)
downloadsynapse-cf1059d045640485a5a0b1e3d945b796b0e6f228.tar.xz
Fix a long-standing bug where the user directory would return 1 more row than requested. (#14631)
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_user_directory.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/storage/test_user_directory.py b/tests/storage/test_user_directory.py
index 5b60cf5285..88c7d5fec0 100644
--- a/tests/storage/test_user_directory.py
+++ b/tests/storage/test_user_directory.py
@@ -449,6 +449,12 @@ class UserDirectoryStoreTestCase(HomeserverTestCase):
         )
 
     @override_config({"user_directory": {"search_all_users": True}})
+    def test_search_user_limit_correct(self) -> None:
+        r = self.get_success(self.store.search_user_dir(ALICE, "bob", 1))
+        self.assertTrue(r["limited"])
+        self.assertEqual(1, len(r["results"]))
+
+    @override_config({"user_directory": {"search_all_users": True}})
     def test_search_user_dir_stop_words(self) -> None:
         """Tests that a user can look up another user by searching for the start if its
         display name even if that name happens to be a common English word that would