Fix failing test

master
Valentin Brandl 2020-05-14 15:05:06 +02:00 committed by Denis Kasak
parent 4675a72e6b
commit 49e913865d
1 changed files with 49 additions and 47 deletions

View File

@ -140,7 +140,7 @@ mod test {
#[cfg(not(feature = "messages"))] #[cfg(not(feature = "messages"))]
assert_eq!( assert_eq!(
r#"{ serde_json::json!({
"!roomid:example.com": { "!roomid:example.com": {
"room_id": "!roomid:example.com", "room_id": "!roomid:example.com",
"room_name": { "room_name": {
@ -154,6 +154,7 @@ mod test {
"own_user_id": "@example:example.com", "own_user_id": "@example:example.com",
"creator": null, "creator": null,
"members": {}, "members": {},
"display_names": {},
"typing_users": [], "typing_users": [],
"power_levels": null, "power_levels": null,
"encrypted": null, "encrypted": null,
@ -161,15 +162,16 @@ mod test {
"unread_notifications": null, "unread_notifications": null,
"tombstone": null "tombstone": null
} }
}"#, }),
serde_json::to_string_pretty(&joined_rooms).unwrap() serde_json::to_value(&joined_rooms).unwrap()
); );
#[cfg(feature = "messages")] #[cfg(feature = "messages")]
assert_eq!( assert_eq!(
r#"{ serde_json::json!({
"!roomid:example.com": { "!roomid:example.com": {
"room_id": "!roomid:example.com", "room_id": "!roomid:example.com",
"display_names": {},
"room_name": { "room_name": {
"name": null, "name": null,
"canonical_alias": null, "canonical_alias": null,
@ -189,8 +191,8 @@ mod test {
"unread_notifications": null, "unread_notifications": null,
"tombstone": null "tombstone": null
} }
}"#, }),
serde_json::to_string_pretty(&joined_rooms).unwrap() serde_json::to_value(&joined_rooms).unwrap()
); );
} }