From 29b952a72666e692d94f54b3ef053a3616018789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 11 Sep 2022 10:52:14 +0200 Subject: [PATCH] tests: ensure occupants count is correct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/room.rs | 4 ++-- src/tests.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/room.rs b/src/room.rs index 84b00ce..4c5fa47 100644 --- a/src/room.rs +++ b/src/room.rs @@ -37,8 +37,8 @@ pub type Nick = String; #[derive(Debug)] pub struct Room { - jid: BareJid, - occupants: HashMap, + pub jid: BareJid, + pub occupants: HashMap, } impl Room { diff --git a/src/tests.rs b/src/tests.rs index f549615..3449714 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -142,7 +142,7 @@ async fn test_0045_join_presence_empty_room() { assert_eq!(rooms.len(), 1); match rooms.get(&roomjid) { - Some(_) => (), + Some(room) => assert_eq!(room.occupants.len(), 1), None => panic!(), } } @@ -197,7 +197,7 @@ async fn test_0045_join_presence_nick_already_assigned() { component.assert(); match rooms.get(&roomjid) { - Some(_) => (), + Some(room) => assert_eq!(room.occupants.len(), 1), None => panic!(), } }