From 24f69946739c77506ed81b15aa5b144a82d4f43c Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Sat, 10 Aug 2024 23:12:49 +0200 Subject: [PATCH] test: get url --- src/components.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components.rs b/src/components.rs index 7de71f8..e81deb2 100644 --- a/src/components.rs +++ b/src/components.rs @@ -427,6 +427,22 @@ mod tests { use super::*; + #[test] + fn get_url() { + let url = "http://hoodie.de/"; + let event = Event::new().url(url).done(); + + let serialized = event.to_string(); + let reparsed = + dbg!(Other::try_from(crate::parser::Component::<'_>::try_from(serialized.as_str()).unwrap()) + .unwrap()); + + assert_eq!(event.get_url(), Some(url)); + assert_eq!(reparsed.get_url(), Some(url)); + eprintln!("{}", serialized); + dbg!(event); + } + #[test] fn get_properties_unset() { let event = Event::new();