Add test for mailto address with query params (#655)

This commit is contained in:
Matthias 2022-06-29 10:19:17 +02:00 committed by GitHub
parent 2e6caa512c
commit 487d88cefe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -352,4 +352,20 @@ mod tests {
assert_eq!(links, expected_urls);
}
#[tokio::test]
async fn test_email_with_query_params() {
let input = Input {
source: InputSource::String(
r#"This is a mailto:user@example.com?subject=Hello link"#.to_string(),
),
file_type_hint: None,
excluded_paths: None,
};
let links = collect(vec![input], None).await;
let expected_links = HashSet::from_iter([mail("user@example.com")]);
assert_eq!(links, expected_links);
}
}