@@ -239,6 +239,7 @@ class MessageSearchTest(HomeserverTestCase):
239
239
("fox -nope" , (True , False )),
240
240
("fox -brown" , (False , True )),
241
241
('"fox" quick' , True ),
242
+ ('"fox quick' , True ),
242
243
('"quick brown' , True ),
243
244
('" quick "' , True ),
244
245
('" nope"' , False ),
@@ -268,15 +269,6 @@ def prepare(
268
269
response = self .helper .send (self .room_id , self .PHRASE , tok = self .access_token )
269
270
self .assertIn ("event_id" , response )
270
271
271
- # The behaviour of a missing trailing double quote changed in PostgreSQL 14
272
- # from ignoring the initial double quote to treating it as a phrase.
273
- main_store = homeserver .get_datastores ().main
274
- found = False
275
- if isinstance (main_store .database_engine , PostgresEngine ):
276
- assert main_store .database_engine ._version is not None
277
- found = main_store .database_engine ._version < 140000
278
- self .COMMON_CASES .append (('"fox quick' , (found , True )))
279
-
280
272
def test_tokenize_query (self ) -> None :
281
273
"""Test the custom logic to tokenize a user's query."""
282
274
cases = (
@@ -288,9 +280,9 @@ def test_tokenize_query(self) -> None:
288
280
("fox -brown" , ["fox" , SearchToken .Not , "brown" ]),
289
281
("- fox" , [SearchToken .Not , "fox" ]),
290
282
('"fox" quick' , [Phrase (["fox" ]), SearchToken .And , "quick" ]),
291
- # No trailing double quote .
292
- ('"fox quick' , [Phrase ([ "fox" , "quick" ]) ]),
293
- ('"-fox quick' , [Phrase ([ "- fox" , "quick" ]) ]),
283
+ # No trailing double quoe .
284
+ ('"fox quick' , ["fox" , SearchToken . And , "quick" ]),
285
+ ('"-fox quick' , [SearchToken . Not , " fox" , SearchToken . And , "quick" ]),
294
286
('" quick "' , [Phrase (["quick" ])]),
295
287
(
296
288
'q"uick brow"n' ,
0 commit comments