From 49e913865d05766cb0d6f49601f36b939609cf91 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Thu, 14 May 2020 15:05:06 +0200 Subject: [PATCH] Fix failing test --- matrix_sdk_base/src/state/mod.rs | 96 ++++++++++++++++---------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/matrix_sdk_base/src/state/mod.rs b/matrix_sdk_base/src/state/mod.rs index abf3ed82..dfcf71fd 100644 --- a/matrix_sdk_base/src/state/mod.rs +++ b/matrix_sdk_base/src/state/mod.rs @@ -140,57 +140,59 @@ mod test { #[cfg(not(feature = "messages"))] assert_eq!( - r#"{ - "!roomid:example.com": { - "room_id": "!roomid:example.com", - "room_name": { - "name": null, - "canonical_alias": null, - "aliases": [], - "heroes": [], - "joined_member_count": null, - "invited_member_count": null - }, - "own_user_id": "@example:example.com", - "creator": null, - "members": {}, - "typing_users": [], - "power_levels": null, - "encrypted": null, - "unread_highlight": null, - "unread_notifications": null, - "tombstone": null - } -}"#, - serde_json::to_string_pretty(&joined_rooms).unwrap() + serde_json::json!({ + "!roomid:example.com": { + "room_id": "!roomid:example.com", + "room_name": { + "name": null, + "canonical_alias": null, + "aliases": [], + "heroes": [], + "joined_member_count": null, + "invited_member_count": null + }, + "own_user_id": "@example:example.com", + "creator": null, + "members": {}, + "display_names": {}, + "typing_users": [], + "power_levels": null, + "encrypted": null, + "unread_highlight": null, + "unread_notifications": null, + "tombstone": null + } + }), + serde_json::to_value(&joined_rooms).unwrap() ); #[cfg(feature = "messages")] assert_eq!( - r#"{ - "!roomid:example.com": { - "room_id": "!roomid:example.com", - "room_name": { - "name": null, - "canonical_alias": null, - "aliases": [], - "heroes": [], - "joined_member_count": null, - "invited_member_count": null - }, - "own_user_id": "@example:example.com", - "creator": null, - "members": {}, - "messages": [], - "typing_users": [], - "power_levels": null, - "encrypted": null, - "unread_highlight": null, - "unread_notifications": null, - "tombstone": null - } -}"#, - serde_json::to_string_pretty(&joined_rooms).unwrap() + serde_json::json!({ + "!roomid:example.com": { + "room_id": "!roomid:example.com", + "display_names": {}, + "room_name": { + "name": null, + "canonical_alias": null, + "aliases": [], + "heroes": [], + "joined_member_count": null, + "invited_member_count": null + }, + "own_user_id": "@example:example.com", + "creator": null, + "members": {}, + "messages": [], + "typing_users": [], + "power_levels": null, + "encrypted": null, + "unread_highlight": null, + "unread_notifications": null, + "tombstone": null + } + }), + serde_json::to_value(&joined_rooms).unwrap() ); }