-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3eb05a
commit 69d57b9
Showing
13 changed files
with
622 additions
and
129 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
packages/apis/src/decomposed_defs/email_addr_with_name.json
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -89,12 +89,12 @@ pub fn extract_email_domain_idxes( | |
extract_substr_idxes(input_str, &serde_json::from_str(regex_config).unwrap()) | ||
} | ||
|
||
pub fn extract_email_addr_with_name_idxes( | ||
input_str: &str, | ||
) -> Result<Vec<(usize, usize)>, ExtractSubstrssError> { | ||
let regex_config = include_str!("./decomposed_defs/email_addr_with_name.json"); | ||
extract_substr_idxes(input_str, &serde_json::from_str(regex_config).unwrap()) | ||
} | ||
// pub fn extract_email_addr_with_name_idxes( | ||
// input_str: &str, | ||
// ) -> Result<Vec<(usize, usize)>, ExtractSubstrssError> { | ||
// let regex_config = include_str!("./decomposed_defs/email_addr_with_name.json"); | ||
// extract_substr_idxes(input_str, &serde_json::from_str(regex_config).unwrap()) | ||
// } | ||
|
||
pub fn extract_from_all_idxes( | ||
input_str: &str, | ||
|
@@ -166,20 +166,20 @@ mod test { | |
assert_eq!(idxes, vec![(17, 38)]); | ||
} | ||
|
||
#[test] | ||
fn test_email_addr_with_name_valid1() { | ||
let input_str = "from:[email protected] <[email protected]>"; | ||
let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
assert_eq!(idxes, vec![(18, 39)]); | ||
} | ||
|
||
#[test] | ||
fn test_email_addr_with_name_valid2() { | ||
// "末神 奏宙" has 13 bytes. | ||
let input_str = "from:\"末神 奏宙\" <[email protected]>"; | ||
let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
assert_eq!(idxes, vec![(22, 43)]); | ||
} | ||
// #[test] | ||
// fn test_email_addr_with_name_valid1() { | ||
// let input_str = "from:[email protected] <[email protected]>"; | ||
// let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
// assert_eq!(idxes, vec![(18, 39)]); | ||
// } | ||
|
||
// #[test] | ||
// fn test_email_addr_with_name_valid2() { | ||
// // "末神 奏宙" has 13 bytes. | ||
// let input_str = "from:\"末神 奏宙\" <[email protected]>"; | ||
// let idxes = extract_email_addr_with_name_idxes(input_str).unwrap(); | ||
// assert_eq!(idxes, vec![(22, 43)]); | ||
// } | ||
|
||
#[test] | ||
fn test_email_from_all_valid() { | ||
|
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.