From 487d88cefe59040c6766d5fb9e8ead2041f6ea4f Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 29 Jun 2022 10:19:17 +0200 Subject: [PATCH] Add test for mailto address with query params (#655) --- lychee-lib/src/collector.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lychee-lib/src/collector.rs b/lychee-lib/src/collector.rs index 117d746..8daa0d3 100644 --- a/lychee-lib/src/collector.rs +++ b/lychee-lib/src/collector.rs @@ -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); + } }