diff options
| author | R0flcopt3r <12752060+R0flcopt3r@users.noreply.github.com> | 2021-10-09 18:54:35 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2021-10-10 16:21:55 +0200 |
| commit | e1e364a7fc0b6914c79e71fb75a4c3fd64691c1a (patch) | |
| tree | 624cc323ffcdfecc696ea52cfa05ad1129e69b80 | |
| parent | refactor url_preview() to run all URLs in parallel (diff) | |
fixed tests with new refactor
| -rw-r--r-- | src/hooks/url.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hooks/url.rs b/src/hooks/url.rs index 22b7d64..7847969 100644 --- a/src/hooks/url.rs +++ b/src/hooks/url.rs @@ -88,6 +88,7 @@ mod tests { use super::msg_builder; use super::url_parser; use super::url_title; + use anyhow::{Error, Result}; #[test] fn test_url_titel() { @@ -98,8 +99,7 @@ mod tests { let title: String = tokio_test::block_on(url_title("https://google.com")).unwrap(); assert_eq!(title.as_str(), "Google"); - let title: Option<String> = tokio_test::block_on(url_title("random_site")); - assert_eq!(title, None) + assert!(tokio_test::block_on(url_title("random_site")).is_err()) } #[test] fn test_url_parser() { @@ -138,7 +138,7 @@ mod tests { assert_eq!(urls.len(), 3); for url in &urls { - if let Some(title) = tokio_test::block_on(url_title(&url.as_str())) { + if let Ok(title) = tokio_test::block_on(url_title(&url.as_str())) { titles.push(title); } } |
