-
-
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.
Showing
4 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use deltachat_message_parser::parser::Element::*; | ||
use deltachat_message_parser::parser::{parse_desktop_set, parse_markdown_text, parse_only_text}; | ||
|
||
/// don't parse fediverse handles as email addresses. | ||
/// as disscussed in https://github.com/deltachat/message-parser/issues/82 | ||
#[test] | ||
fn text_only_fediverse_address_should_be_parsed_as_text() { | ||
assert_eq!( | ||
parse_only_text("you can reach me on @[email protected]!"), | ||
vec![ | ||
Text("you can reach me on "), | ||
Text("@[email protected]"), | ||
Text("!") | ||
] | ||
); | ||
} | ||
|
||
#[test] | ||
fn desktop_set_fediverse_address_should_be_parsed_as_text() { | ||
assert_eq!( | ||
parse_desktop_set("you can reach me on @[email protected]!"), | ||
vec![ | ||
Text("you can reach me on "), | ||
Text("@[email protected]"), | ||
Text("!") | ||
] | ||
); | ||
} | ||
|
||
#[test] | ||
fn markdown_fediverse_address_should_be_parsed_as_text() { | ||
assert_eq!( | ||
parse_markdown_text("you can reach me on @[email protected]!"), | ||
vec![ | ||
Text("you can reach me on "), | ||
Text("@[email protected]"), | ||
Text("!") | ||
] | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod fediverse_handle_82; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod based_on_issue; | ||
mod emoji; | ||
mod links; | ||
mod text_to_ast; |