From 08d3e0d43e60f8bfba8a178e4c171fceb0272c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 11 Jun 2022 19:00:37 +0200 Subject: [PATCH] identifiers: Make some test assertions more helpful --- crates/ruma-common/src/identifiers/matrix_uri.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/ruma-common/src/identifiers/matrix_uri.rs b/crates/ruma-common/src/identifiers/matrix_uri.rs index 74fd6839..1620a212 100644 --- a/crates/ruma-common/src/identifiers/matrix_uri.rs +++ b/crates/ruma-common/src/identifiers/matrix_uri.rs @@ -901,7 +901,7 @@ mod tests { let matrix_uri = MatrixUri::parse("matrix:u/jplatte:notareal.hs").expect("Failed to create MatrixUri."); assert_eq!(matrix_uri.id(), &user_id!("@jplatte:notareal.hs").into()); - assert!(matrix_uri.action().is_none()); + assert_eq!(matrix_uri.action(), None); let matrix_uri = MatrixUri::parse("matrix:u/jplatte:notareal.hs?action=chat") .expect("Failed to create MatrixUri."); @@ -915,8 +915,8 @@ mod tests { let matrix_uri = MatrixUri::parse("matrix:roomid/ruma:notareal.hs?via=notareal.hs") .expect("Failed to create MatrixToUri."); assert_eq!(matrix_uri.id(), &room_id!("!ruma:notareal.hs").into()); - assert_eq!(matrix_uri.via(), &vec![server_name!("notareal.hs").to_owned()]); - assert!(matrix_uri.action().is_none()); + assert_eq!(matrix_uri.via(), &[server_name!("notareal.hs").to_owned()]); + assert_eq!(matrix_uri.action(), None); let matrix_uri = MatrixUri::parse("matrix:r/ruma:notareal.hs/e/event:notareal.hs") .expect("Failed to create MatrixToUri."); @@ -931,8 +931,8 @@ mod tests { matrix_uri.id(), &(room_id!("!ruma:notareal.hs"), event_id!("$event:notareal.hs")).into() ); - assert!(matrix_uri.via().is_empty()); - assert!(matrix_uri.action().is_none()); + assert_eq!(matrix_uri.via().len(), 0); + assert_eq!(matrix_uri.action(), None); let matrix_uri = MatrixUri::parse("matrix:roomid/ruma:notareal.hs/e/event:notareal.hs?via=notareal.hs&action=join&via=anotherinexistant.hs")