From bb935211034a781c5f5271b814a3923169c1d0b8 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 24 Sep 2024 00:55:10 +0000 Subject: [PATCH] fix tests for structured Mxc Signed-off-by: Jason Volk --- crates/ruma-common/src/identifiers/mxc_uri.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/ruma-common/src/identifiers/mxc_uri.rs b/crates/ruma-common/src/identifiers/mxc_uri.rs index d1513bf6..bf1ef2fa 100644 --- a/crates/ruma-common/src/identifiers/mxc_uri.rs +++ b/crates/ruma-common/src/identifiers/mxc_uri.rs @@ -102,7 +102,7 @@ impl<'a> TryFrom<&'a OwnedMxcUri> for Mxc<'a> { mod tests { use ruma_identifiers_validation::error::MxcUriError; - use super::{MxcUri, OwnedMxcUri}; + use super::{Mxc, MxcUri, OwnedMxcUri}; #[test] fn parse_mxc_uri() { @@ -111,7 +111,10 @@ mod tests { assert!(mxc.is_valid()); assert_eq!( mxc.parts(), - Ok(("127.0.0.1".try_into().expect("Failed to create ServerName"), "asd32asdfasdsd")) + Ok(Mxc { + server_name: "127.0.0.1".try_into().expect("Failed to create ServerName"), + media_id: "asd32asdfasdsd", + }) ); } @@ -146,7 +149,10 @@ mod tests { assert!(mxc.is_valid()); assert_eq!( mxc.parts(), - Ok(("server".try_into().expect("Failed to create ServerName"), "1234id")) + Ok(Mxc { + server_name: "server".try_into().expect("Failed to create ServerName"), + media_id: "1234id" + }) ); } }