-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bot command suggestion with
@
- char was detected as email address
fixes #53
- Loading branch information
1 parent
1237482
commit d564eb9
Showing
4 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -609,3 +609,31 @@ fn link_in_parenthesis2() { | |
] | ||
); | ||
} | ||
|
||
|
||
#[test] | ||
fn bot_suggestion_is_no_email() { | ||
assert_eq!( | ||
parse_only_text("/command@[email protected]"), | ||
vec![ | ||
BotCommandSuggestion("/command@[email protected]"), | ||
] | ||
); | ||
assert_eq!( | ||
parse_only_text("\n/command@[email protected]"), | ||
vec![ | ||
Linebreak, | ||
BotCommandSuggestion("/command@[email protected]"), | ||
] | ||
); | ||
|
||
assert_eq!( | ||
parse_only_text("Bots that can be selected \n/command@[email protected] BOT"), | ||
vec![ | ||
Text("Bots that can be selected "), | ||
Linebreak, | ||
BotCommandSuggestion("/command@[email protected]"), | ||
Text(" BOT"), | ||
] | ||
); | ||
} |