fix(python/robomp): updated mention regex to correctly reject suffixes
- Updated the mention extraction regex to prevent partial matching when a suffix follows the `[bot]` identifier. - Added a regression test to ensure that invalid extended suffixes are correctly rejected.
This commit is contained in:
@@ -538,6 +538,10 @@ def test_extract_mention_strips_literal_app_suffix_from_body() -> None:
|
||||
assert extract_mention("@roboomp[bot] go ahead", "roboomp[bot]") == "go ahead"
|
||||
|
||||
|
||||
def test_extract_mention_rejects_extended_literal_app_suffix() -> None:
|
||||
assert extract_mention("@roboomp[bot]-helper go ahead", "roboomp[bot]") is None
|
||||
|
||||
|
||||
def test_extract_mention_returns_none_without_mention() -> None:
|
||||
assert extract_mention("hello there", "robomp-bot") is None
|
||||
assert extract_mention(None, "robomp-bot") is None
|
||||
|
||||
Reference in New Issue
Block a user