aboutsummaryrefslogtreecommitdiff
path: root/src/hooks/url.rs
diff options
context:
space:
mode:
authorR0flcopt3r <12752060+R0flcopt3r@users.noreply.github.com>2021-10-09 18:54:35 +0200
committerMax Audron <audron@cocaine.farm>2021-10-10 16:21:55 +0200
commite1e364a7fc0b6914c79e71fb75a4c3fd64691c1a (patch)
tree624cc323ffcdfecc696ea52cfa05ad1129e69b80 /src/hooks/url.rs
parentrefactor url_preview() to run all URLs in parallel (diff)
fixed tests with new refactor
Diffstat (limited to 'src/hooks/url.rs')
-rw-r--r--src/hooks/url.rs6
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);
}
}