mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 07:27:17 +02:00
avoid erroneous multimatch
This commit is contained in:
parent
0fa3095359
commit
f8de9a484e
2 changed files with 5 additions and 1 deletions
|
|
@ -1352,7 +1352,7 @@ class ContribRPObject(DefaultObject):
|
|||
results.extend(
|
||||
[
|
||||
obj
|
||||
for obj in search_obj(searched_obj.key, candidates=candidates, **kwargs)
|
||||
for obj in search_obj(searched_obj.key, candidates=[searched_obj], **kwargs)
|
||||
if obj not in results
|
||||
]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -356,6 +356,10 @@ class TestRPSystem(BaseEvenniaTest):
|
|||
result = self.speaker.get_search_result("something", candidates)
|
||||
self.assertIn(self.obj1, result)
|
||||
self.assertIn(self.obj2, result)
|
||||
# search by sdesc with 2-disambiguator: only second object should be found
|
||||
result = self.speaker.get_search_result("2-something", candidates)
|
||||
self.assertNotIn(self.obj1, result)
|
||||
self.assertIn(self.obj2, result)
|
||||
# search empty candidates: no objects should be found
|
||||
result = self.speaker.get_search_result("something", candidates=[])
|
||||
self.assertNotIn(self.obj1, result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue